Supervisor / supervisor

Supervisor process control system for Unix (supervisord)
http://supervisord.org
Other
8.52k stars 1.25k forks source link

Feature request: Control CPU priority of programs by setting their 'niceness' #719

Open nilstoedtmann opened 8 years ago

nilstoedtmann commented 8 years ago

I'd like to have an optional setting nice= in the [program:x] section that would start a program with a certain niceness value. It would be an integer between -20 (high CPU priority) and 19 (low CPU prio), default being 0.

It is already simple to de-prioritise supervised processes, just prefix the command with nice -n $NICENESS with positive value. But giving a non-root program a higher CPU priority (aka assigning a negative niceness value) currently requires a nasty sudo command that renders several other supervisor settings (e.g. user, environment) useless.

Google for more info about niceness and CPU priority.

bolek2000 commented 6 years ago

In the recent version 3.3.1 of supervisord on Ubuntu 14.04 prefixing my program with nice didn't work ??

timabbott commented 5 years ago

This would be a really valuable feature, and supervisord is the right place to do it.

superdump commented 4 years ago

In the recent version 3.3.1 of supervisord on Ubuntu 14.04 prefixing my program with nice didn't work ??

Same for me with supervisord 4.2.0.

timabbott commented 4 years ago

It definitely works to do that; we do it in Zulip. Maybe you didn't supervisorctl reread; supervisorctl update before restarting your service? It's an easy mistake to make.

I'd still really love to have this be a native feature of supervisord; it seems like the kind of thing that'd be simple to implement and be a big convenience win.

Would the maintainers accept a patch to add it?

ioniks commented 3 years ago

I need this too 😁

MysticRyuujin commented 2 years ago

:wave:

litnialex commented 1 year ago

Yes, that would be nice)

Although it's possible to run a command with a higher priority by prefixing it with nice -n -5.

It's funny that nice -5 doesn't work, making niceness +5.

serpent213 commented 9 months ago

Is there a reason for this not being implemented for eight years?