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

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

~# renice -number PID

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

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: