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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-02-2003, 03:24 AM
|
#1
|
Member
Registered: Jul 2001
Posts: 72
Rep:
|
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
|
|
|
10-02-2003, 08:17 PM
|
#2
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,352
|
"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.
|
|
|
10-02-2003, 08:23 PM
|
#3
|
LQ Newbie
Registered: Aug 2003
Location: Chicago
Distribution: Mandrake
Posts: 18
Rep:
|
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.
|
|
|
10-03-2003, 03:43 AM
|
#4
|
Member
Registered: Jul 2001
Posts: 72
Original Poster
Rep:
|
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
|
|
|
10-03-2003, 03:57 AM
|
#5
|
Member
Registered: Jul 2001
Posts: 72
Original Poster
Rep:
|
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
|
|
|
10-03-2003, 11:33 PM
|
#6
|
LQ Newbie
Registered: Aug 2003
Location: Chicago
Distribution: Mandrake
Posts: 18
Rep:
|
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.
|
|
|
10-06-2003, 02:22 AM
|
#7
|
Member
Registered: Jul 2001
Posts: 72
Original Poster
Rep:
|
Thank you for your help. Everything is working fine now.
Cheers,
Peter
|
|
|
10-06-2003, 06:28 AM
|
#8
|
LQ Newbie
Registered: Aug 2003
Location: Chicago
Distribution: Mandrake
Posts: 18
Rep:
|
No problem!
Later,
-electron_lemon
|
|
|
All times are GMT -5. The time now is 01:22 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|