[arch-general] renice Bash at login

Mauro Santos registo.mailling at gmail.com
Mon Apr 23 11:17:35 EDT 2012


On 23-04-2012 14:48, Geert Hendrickx wrote:
> On Mon, Apr 23, 2012 at 14:25:09 +0100, Leonidas Spyropoulos wrote:
>> Well I want to decrease the priority of all users logged into the
>> system (expect root) at login. So let's say run every bash and every
>> spawned process that a user run with priority 5.
> 
> 
> 
> If your users are just running vi and grep and the like, and not any
> long-running, CPU intensitive tasks, this will make zero difference in
> overall performance of your server.
> 
> 
> 	Geert
> 
> 

I've dealt with CPU hogging processes with a cron job. It runs every
hour and does the following _only_ for user accounts (it doesn't touch
root or system/daemons accounts):
for every process check if it has used more than 30min of cpu time,
if yes then check niceness, if niceness is lower than 15, raise niceness
to 15, otherwise do nothing.

Normal processes should not be affected, short spikes of cpu usage are
allowed but cpu hogging processes will get niced not to slow the whole
system to a halt. The idea is to interfere as little as possible with
the running processes.

-- 
Mauro Santos


More information about the arch-general mailing list