nefelim4ag / Ananicy

Ananicy - is Another auto nice daemon, with community rules support (Use pull request please)
GNU General Public License v3.0
569 stars 78 forks source link

Applying resource limits on process creation #82

Open Thermi opened 6 years ago

Thermi commented 6 years ago

I think we can all agree that it's a problem that ananicy doesn't apply the settings right away when a process is created. That is because it runs each rule with pgrep and other applications at a time with a sleep time in between the calls. That is to ensure that ananicy does not take up too much CPU time. A better solution would be to either have the settings be applied at process creation or shortly after.

There are two possible solutions to do this:

nefelim4ag commented 6 years ago

Sorry for long answer, just no spare time.


I understood what you want and also think about that, but it's create to many problems for just set appropriate priority to processes.

In kernel fix, just a bad idea, thats are user space problem.

PATH magic will create too many overhead for process starting and will not work always, as example for steam that will not work. For gcc that will create noticeable overhead.

That can work and may be useful for some thing, but for that we need much more smart method to gen overwrites in /usr/local/bin. For make and other rare called stuff that can work.

If you wish, you can play with that, i'm not refuse, i'm just think that not worth of work.

May be at first ananicy must be rewritten by some more efficient lang (CPU/Memory) then bash. (I'm also not sure if that worth of resources). Because wrap processes with bash script which fork() & execv() several other tools, looks too costly.

Thanks.