LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-02-2003, 03:24 AM   #1
teeno
Member
 
Registered: Jul 2001
Posts: 72

Rep: Reputation: 15
crontab high CPU


Hi All,

Is it normal for crontab to use a lot of CPU? On my box it is using about 95% CPU most of the time.

Thank you,
Peter
 
Old 10-02-2003, 08:17 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"Is it normal for crontab to use a lot of CPU? On my box it is using about 95% CPU most of the time."

I don't thing that this is normal. Check to make sure that you are not executing something once a minute that you meant to execute once a day or some such. Or possibly some chrontab initiated command is going into a loop and never quitting.


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Last edited by jailbait; 10-02-2003 at 08:23 PM.
 
Old 10-02-2003, 08:23 PM   #3
electron_lemon
LQ Newbie
 
Registered: Aug 2003
Location: Chicago
Distribution: Mandrake
Posts: 18

Rep: Reputation: 0
Normal? That depends on what cron is doing.

Open a terminal and run `ps -ef --sort c` and tell me what the bottom few lines say.

Also, tell me what `grep cron /var/log/syslog` says.

This will speak volumes about what's going on.
 
Old 10-03-2003, 03:43 AM   #4
teeno
Member
 
Registered: Jul 2001
Posts: 72

Original Poster
Rep: Reputation: 15
Hi,

Thank you for your replies.

The most frequent job that is executed is /sbin/rmmod -as. Which runs every ten minutes.

Here is the output from ps:

root 16751 1 0 Oct02 ? 00:00:00 ncpd -u apache -g
apache 17348 13855 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 17349 13855 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 17350 13855 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 17351 13855 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 17354 13855 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 17355 13855 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 17356 13855 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 17359 13855 0 04:02 ? 00:00:00 /usr/sbin/httpd
root 17871 13674 0 08:28 pts/1 00:00:00 ps -ef --sort c
root 17855 13715 0 08:23 ? 00:00:00 kedit -caption Text
mysql 17668 876 0 07:43 ? 00:00:08 /usr/sbin/mysqld --
root 17757 13715 0 08:15 ? 00:00:02 kwrite -caption
mysql 17679 876 0 07:58 ? 00:00:09 /usr/sbin/mysqld --
mysql 17646 876 0 07:15 ? 00:00:30 /usr/sbin/mysqld --
root 17865 8110 1 08:27 pts/1 00:00:00 [bandwidthd <defun
root 14715 14714 99 Sep19 ? 13-17:58:25 crontab -u root -e


I have no syslog file (not sure why) but this is what the cron log says:

Oct 3 07:00:00 localhost CROND[17629]: (root) CMD (/usr/local/bin/webalizer -c /etc/webalizer.squid.conf)

Oct 3 07:00:00 localhost CROND[17630]: (root) CMD (/usr/local/bin/webalizer -c /etc/webalizer.conf)

Oct 3 07:01:01 localhost CROND[17635]: (root) CMD (run-parts /etc/cron.hourly)

Oct 3 07:10:00 localhost CROND[17641]: (root) CMD ( /sbin/rmmod -as)

Oct 3 07:20:00 localhost CROND[17654]: (root) CMD ( /sbin/rmmod -as)

Oct 3 07:30:00 localhost CROND[17660]: (root) CMD ( /sbin/rmmod -as)

Oct 3 07:40:00 localhost CROND[17666]: (root) CMD ( /sbin/rmmod -as)

Oct 3 07:50:00 localhost CROND[17673]: (root) CMD ( /sbin/rmmod -as)

Oct 3 08:00:00 localhost CROND[17689]: (root) CMD ( /sbin/rmmod -as)

Oct 3 08:00:00 localhost CROND[17690]: (root) CMD (/usr/local/bin/webalizer -c /etc/webalizer.squid.conf)

Oct 3 08:00:00 localhost CROND[17691]: (root) CMD (/usr/local/bin/webalizer -c /etc/webalizer.conf)

Oct 3 08:01:00 localhost CROND[17697]: (root) CMD (run-parts /etc/cron.hourly)

Oct 3 08:10:00 localhost CROND[17729]: (root) CMD ( /sbin/rmmod -as)

Oct 3 08:20:00 localhost CROND[17786]: (root) CMD ( /sbin/rmmod -as)

Oct 3 08:30:00 localhost CROND[17874]: (root) CMD ( /sbin/rmmod -as)


Thank you for your help,

Peter
 
Old 10-03-2003, 03:57 AM   #5
teeno
Member
 
Registered: Jul 2001
Posts: 72

Original Poster
Rep: Reputation: 15
I just realized that its crontab using all the CPU not crond.

root 14715 14714 99 Sep19 ? 13-17:58:25 crontab -u root –e

Have you any idea why this could be?

Should I just kill it?

Just another quick question, why don’t I have a syslog file?

Cheers,
Peter
 
Old 10-03-2003, 11:33 PM   #6
electron_lemon
LQ Newbie
 
Registered: Aug 2003
Location: Chicago
Distribution: Mandrake
Posts: 18

Rep: Reputation: 0
Well, rmmod is for unloading unused kernel modules, and your cron has it running every 10 minutes, which is WAY too much. Set it to run every 2-4 hours instead.

Another option would be to set cron to run rmmod with very low priority, so that it only uses CPU time not used by any other app. To do this, have cron run `/bin/nice -19 /sbin/rmmod`.

To change the behavior of cron, search files in /var/spool/cron, /etc/cron.d and search /etc/crontab for lines containing `/sbin/rmmod` and replace them with the line above.

As for your crontab app using cpu, the command `crontab -u root -e` just edits root's crontab. I don't know why it's running, so kill it.

BTW, different distros divide up logfiles differently. I use Mandrake 9.1, which happens to use /var/log/syslog. I'm pretty sure redhat does, too. Most likely you run a different distro, and in that case you should just look in /var/log/messages, which is the catch-all file.

Last edited by electron_lemon; 10-03-2003 at 11:36 PM.
 
Old 10-06-2003, 02:22 AM   #7
teeno
Member
 
Registered: Jul 2001
Posts: 72

Original Poster
Rep: Reputation: 15
Thank you for your help. Everything is working fine now.

Cheers,
Peter
 
Old 10-06-2003, 06:28 AM   #8
electron_lemon
LQ Newbie
 
Registered: Aug 2003
Location: Chicago
Distribution: Mandrake
Posts: 18

Rep: Reputation: 0
No problem!

Later,
-electron_lemon
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
High Cpu usage untak Debian 21 01-23-2007 06:21 AM
cpu usage high corbintechboy VectorLinux 2 07-27-2005 08:11 AM
High CPU Temp Mojojo Linux - Hardware 4 12-19-2004 12:10 PM
CPU temperature too high Mr_Zet Linux - Laptop and Netbook 9 11-17-2004 10:55 AM
High CPU temperature Inexactitude Linux - Hardware 6 04-28-2004 02:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration