View Full Version : cron + mvchannels = spiked CPU
BubbleLamp
08-31-2002, 04:18 AM
Well after swapping over to cron to fire off mvchannels, I noticed that each time it runs the CPU usage goes off the scale.
This is different than what happens when it's looped from rc.sysinit. It usually goes high during the first run, but then settles in with much lower usage on subsequent loops.
Unless someone can tell me how to eliminate this, I think I'll go back to the old way.
Also , have uoy looked at the size of the log file for cron. It adds a line every time it runs a file.
AlphaWolf
08-31-2002, 11:33 AM
Every time you start almost any TCL script, it has to pool the database (using dbopen), which can take a bite out of your processing time. When you loop a script over and over, it only pools the database once. If you setpri 1 I don't think it should matter much.
You could also specify a smaller pool size, just try different numbers following the dbopen command.
So far as the cron log, dtype suggested to me earlier to link it to /dev/null. I also figured you could set another cron job to delete it every 24 hours or so.
BubbleLamp
08-31-2002, 01:02 PM
Originally posted by AlphaWolf
Every time you start almost any TCL script, it has to pool the database (using dbopen), which can take a bite out of your processing time. When you loop a script over and over, it only pools the database once. If you setpri 1 I don't think it should matter much.
You could also specify a smaller pool size, just try different numbers following the dbopen command.
So far as the cron log, dtype suggested to me earlier to link it to /dev/null. I also figured you could set another cron job to delete it every 24 hours or so.
I am running setpri in rc.sysinit AW. mvchannels does a dbopen/dbclose each time it loops anyway, so it seems that at least for this script, cron isn't a good solution.
genericuser
08-31-2002, 01:34 PM
How are you checking cpu usage?
Even before I setpri 1, the cron solution for mvchannels helped immensely on my system. But if you have a way of actually looking at the cpu usage I will try that out.
BubbleLamp
08-31-2002, 02:04 PM
Originally posted by genericuser
How are you checking cpu usage?
Even before I setpri 1, the cron solution for mvchannels helped immensely on my system. But if you have a way of actually looking at the cpu usage I will try that out.
I just keep running ps aux, and when the cron job kicks in the mvchannels processes show up. Usage goes over 90%, and I get visible hiccups on screen. Running by looping, you get a spike during first execution, but then it drops way down for subsequent loops.
mrblack51
09-02-2002, 09:24 AM
bubblelamp: i am using the setpri in my rc.sysinit, but it wasnt solving my skipping from running tivotitle via cron. I added the setpri, and it worked great, with no skipping. i recommend trying it.
BubbleLamp
09-02-2002, 12:16 PM
Nope, as I said in my reply to AW, I did try setpri in my rc.sysinit. Anyone using setpri AND mvchannels via cron, try running ps aux until you see it kick off and see what usage you are getting.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.