LinuxQuestions.org
Visit Jeremy's Blog.
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 01-17-2005, 09:45 AM   #1
ngwasuma
Member
 
Registered: Jan 2005
Distribution: Fedora11
Posts: 45

Rep: Reputation: 16
Crond Taking Almost 100% Processor Time


I am a newbie in Linux. Recently I setup MRTG to monitor several workstations. I added commands for querying SNMP data to run in 5 min interval using crontab (as shown below


*/5 * * * * /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/bin/comp1.cfg logging /var/log/mrtg.log
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/bin/comp2.cfg logging /var/log/mrtg.log
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/bin/comp3.cfg logging /var/log/mrtg.log

(There are up to 26 computers)

Now, when the tasks are being excecuted, I cant do anything else on the linux 7.2 machine coz its like the tasks take 100% of the processor time.

Is there something I can do to have my key strokes given priority?
 
Old 01-17-2005, 10:25 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
You need to increase the niceness value of the running tasks.
To do this, you can either start the tasks using the nice command (eg through a script), or use this (started from cron at the same time) to change the niceness values after the processes have started running (note that these are backticks, not apostrophies):
Code:
renice +19 `/sbin/pidof mrtg`
(assuming that mrtg is the name of the running process as displayed in top)

You could also look into recompiling your kernel to improve overall system efficiency, or creating multiple swap partitions on different physical drives (if system swapping is causing this latency).
 
Old 01-26-2005, 03:57 AM   #3
ngwasuma
Member
 
Registered: Jan 2005
Distribution: Fedora11
Posts: 45

Original Poster
Rep: Reputation: 16
Do i have to add this command to all the the lines as shown below?

Code:
*/5 * * * * renice +19 `/sbin/pidof /usr/local/mrtg-2/bin/mrtg` /usr/local/mrtg-2/bin/comp1.cfg logging /var/log/mrtg.log
or do i just add the command at the top of my cron tasks?

I beleive there must be several instances of MRTG running during the
execution of the tasks.
 
Old 01-27-2005, 12:00 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
This one line will renice all of your mrtg processes, assuming that they are running when the renice command executes. You don't need to specify it multiple times.
 
Old 01-04-2006, 09:05 AM   #5
ngwasuma
Member
 
Registered: Jan 2005
Distribution: Fedora11
Posts: 45

Original Poster
Rep: Reputation: 16
thanks rjlee
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ubuntu smp: why is kswapd0 taking 100% CPU time? eantoranz Linux - Software 0 10-18-2005 02:38 PM
SuSe 9.0 professional processor jumps to 100% and freezes Ralph_E Suse/Novell 2 06-30-2005 08:50 PM
Java using 100% of processor Mojojo Linux - Software 2 05-08-2005 09:57 PM
xinetd 100% utilization on one processor on a two processor system red hat 9 garnold Linux - General 0 02-02-2004 01:47 PM
change crond time? doublefailure Linux - Software 9 07-08-2002 06:17 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration