Knowledgebase: CGI
How can I prevent my cgi script from hogging my server resources?
Posted by John McDonald on 02 January 2009 09:20 PM
Some cgi's , perl, etc. can be processor hogs. One way to allow these scripts to run without pushing up the server load for more than a few seconds at a time, is to run them nicely.
"The nice command gives you some control over the priority of one job over another.
...processes run at a set priority. You can lower the priority of a process with the nice command so that other processes can be scheduled to use the CPU more frequently than the 'nice' job. ...The general form of the nice command is as follows:
nice -number command ..." From "Using Linux", by Jack Tackett, Jr. & Steve Burnett
To give the lowest possible priority to a command enter:

~# nice -10 command

~# nice -10 reindex.cgi
A running process can have it's priority modified by the superuser using 'renice'.

~# renice -number PID

~# renice -10 53921
(366 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name: