[arch-general] renice Bash at login

Leonidas Spyropoulos artafinde at gmail.com
Mon Apr 23 14:03:17 EDT 2012


On Monday, April 23, 2012, Mauro Santos <registo.mailling at gmail.com> wrote:
> 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.
Can you share the script please?

>
> --
> Mauro Santos
>

-- 
Caution: breathing may be hazardous to your health.

#include <stdio.h>
int main(){printf("%s","\x4c\x65\x6f\x6e\x69\x64\x61\x73");}


More information about the arch-general mailing list