These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Background Housekeeping Process
PostPosted: Tue Mar 08, 2005 4:57 pm 
Beginner
Beginner

Joined: Tue Sep 09, 2003 9:11 pm
Posts: 32
This is a bit off topic - I thought someone here might have a suggestion though.

I am running a process to execute every couple of hours via Quartz. However, right now when the process kicks off it is very database intensive and uses a lot of resources (e.g., CPU).

I am trying to figure out how to set it so that this process (which is basically a housekeeping process and is not time sensitive) does not consume nearly so many resources. Basically some mechanism to slow the process down when the system is loaded with other processes.

I have thought up a couple of different options (insert wait statements at strategic points in the housekeeping process, be very smart about when to launch the process and launch only when CPU usage is low).

I was wondering if anyone else had run into something like this and could share an idea of two. I've thought about playing around with Java Thread priorities but my initial research indicates priorities might not work as well as I would like.

The basics of my system are Linux 2.4.x, Java 1.5, MySQL 4.1 running 24x7. The housekeeping process basically is identifying rows (selecting 1 record at a time) in a table that are "archiveable" and moving the records (and relationships) to another table for reporting purposes.

Any suggestions are more than welcomed.

Thanks in advance.
Chris....


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 8:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Hard one since the answer is ' it depends on requirements '.
For larger applications I have moved background processing (house keeping, or data processing for calculations, stats or billing processes etc) onto a dedicated box away from the web server(s) [or what ever you trying to off load the resources from]. Smaller applications, run it at night when no one is logged on, bigger hardware, load based trigger, etc etc etc ... see it depends. Hope this helps a little.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 9:16 pm 
Beginner
Beginner

Joined: Tue Sep 09, 2003 9:11 pm
Posts: 32
David - thanks... your comments make complete sense and I realize it depends. I was curious what others have done and wanted to make sure I wasn't overlooking something obvious in the java API.

I've thought of the things you mentioned and will probably move to another server at some point. I think I'm going to add a wait() in the processing loop so that we are not flooding the database server with requests from the housekeeping process. We'll probably also use some type of scheduling process to have it run at certain times, and eventaully (when our global customer base picks up and there isn't really a good time to run because the application is being used 24x7 around the world) a load based trigger of some type (this is the one I need to do some more research on).....

Thanks,
Chris....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2005 5:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Download a copy of Quartz and set it up to launch house keeping in a staggered arrangement. This should do for some time, well atleast until your customer base grows significantly. Where can I buy stock ......:-)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2005 5:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Funny I just re-read your first message....your already using it. Ignore me :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.