Using python, I can easily increase the current subtlety of the process:
>>> import os
>>> import psutil
>>>
>>> os.nice(3)
3
>>>
>>> psutil.Process(os.getpid()).nice(10)
>>> psutil.Process(os.getpid()).nice()
10
However, reducing the attractiveness of the process is not possible:
>>> os.nice(-1)
OSError: [Errno 1] Operation not permitted
>>> psutil.Process(os.getpid()).nice(5)
psutil.AccessDenied: psutil.AccessDenied (pid=14955)
What is the right way to do this? And is the ratchet mechanism a mistake or function?
source
share