PipelineFX Forum

Qube! => Installation and Configuration => Topic started by: greggyd on November 12, 2008, 07:05:11 PM

Title: Qube periodic maintenance
Post by: greggyd on November 12, 2008, 07:05:11 PM
Hi,

  Sorry in advance if this is a FAQ, I am a newbie with Qube!

We have a very particular use case with this product that produces many many many small render jobs. Its just the nature of our site. At the moment there are close to 340 000 jobs in Qube and my question is what is the recommended maintenance for this? Do people periodically reset the database? Do the remove jobs individually or do they just leave it?

 Its not critical at the moment but I do notice the load on mysql creeping up and of course there are all the spool files sitting there.

Any recommendations or suggestions would be helpful as I have not seen anything about this in the docs...

Thanks alot,
Greg
Title: Re: Qube periodic maintenance
Post by: eric on November 13, 2008, 05:01:51 AM
You should first remove all the old jobs. The Supervisor performance can be affected by having a significant number of jobs, especially if they are completed.

Next, you will want to look at reducing the number of jobs you're running by using Qube subjobs to render multiple frames. There are tutorials in the Using Qube documentation that can serve as a template for taking advantage of the Supervisor's frame server.
Title: Re: Qube periodic maintenance
Post by: greggyd on November 15, 2008, 03:53:14 AM

Hi Eric, thanks for the reply.

Am I safe to drop the databases and delete the entries from the job and jobid tables manually? Running qbremove on 30000 jobs kind of kills the server ;-)

Unfortunately due to the nature of the web site (http://www.xtranormal.com) we must submit many many small unrelated renders so we are kind of stuck with it. But yes, performance does start to bog down so a cleanup will be good. To bad there is no way to get qube to clean up after itself.

thanks,
Greg
Title: Re: Qube periodic maintenance
Post by: jesse on November 16, 2008, 10:04:34 PM
This is the skeleton of a python script that I use to do cleanup.  It runs as a daily cron job on a linux box.  I've excluded much of the code where the data is interpreted and stored into another database for building reports.

I use 'timesubmit' because 'timecomplete' will not be set for blocked or active jobs. 

Code: [Select]
#!/usr/bin/python
import sys
sys.path.append( "/usr/local/pfx/qube/api/python" )
import qb
from time import time

jobs = qb.jobinfo([]);
for j in jobs:
if j['timesubmit'] < time()-(30*24*60*60):
try:
qb.remove(j['id'])
except:
print "error removing job:",j['id'],sys.exc_info()
Title: Re: Qube periodic maintenance
Post by: troy on November 17, 2008, 09:19:08 PM
Am I safe to drop the databases and delete the entries from the job and jobid tables manually? Running qbremove on 30000 jobs kind of kills the server ;-)

No, don't remove jobs directly via the tables - there are other entries in other tables that refer to those tables, and it can leave a mess - use the API as Jesse shows, or run a 'qbremove' cron in the wee hours when nobody's around.

Hope that helps,

Troy
Title: Re: Qube periodic maintenance
Post by: greggyd on November 23, 2008, 08:34:32 PM
Hi guys,

 Thanks for the replies,  the python script does not remove the /var/spool files. I will try it but from my experience with qbremove I need to run it in a loop with a sleep or it overwhelms the server. The problem is that we can add 20 jibs a minute easily but I cannot remove them fast enough to catch up.

Anyway thanks alot for the advice.

Greg