Setting 'nice' level for specific binary

Karl Latiss karl.latiss at atvert.com.au
Wed Aug 24 04:24:26 UTC 2005


On Tue, 2005-08-23 at 19:58 -0700, Chris wrote:
> Is there a way to globally force a lower priority ('nice' level) on a 
> specific binary executable, that technically can be called from any cgi-bin 
> directory on a single server, where each copy is owned by a different 
> hosting user?  The filename is unique so we can assume any requests to this 
> same filename are for the same binary file.  I'd like to experiment with 
> re-nicing a particular hosted application that at times creates such 
> incredibly high CPU loads that everything else stops responding (httpd, 
> sshd, etc) and you can't even log on to kill these processes.  This 
> typically requires a hard reboot to get things working again.  Because of 
> that I implemented scripts that monitor server load and when things get 
> hairy (server loads exceeding 100+) they stop certain services to give this 
> particular app a chance to exit gracefully, which works for the most part. 
> But it can still take 60-120+ seconds at this type of loads to do anything. 
> Would be nice to run this particular app, many copies of it that is, at 
> lower nice level so we can at least SSH to the server when the load gets 
> this high.  I'd rather have my scripts send me an SMS message when things 
> get hairy but be able to log on via SSH and at least manually control this 
> app at that point, rather than mucking with other services to free up 
> resources.

How about renaming the binary to something else and putting in place a
wrapper script calling nice and the re-named binary?

This way it always runs at some nice value.

-- 
Karl Latiss <karl.latiss at atvert.com.au>
Atvert Systems




More information about the redhat-list mailing list