You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just found this interesting article:
http://friedcpu.wordpress.com/2007/07/17/why-arent-you-using-ionice-yet/
...describing how, on Linux, the "renice" command can be used to change the IO
priority of a process.
Proposal
is to add this functionality in psutil by adding a new property to the Process
class which permits to get and set/change process IO priority.
= API =
This should be the same we used for process niceness/priority ( issue 142 ),
consisting in a unique property for both getting and setting process IO priority.
IOPRIO_CLASS_RT, IOPRIO_CLASS_BE and IOPRIO_CLASS_IDLE constants should be
exposed as well.
Example:
>>> psutil.Process(os.getpid())
>>> psutil.ionice
0
>>> psutil.ionice = psutil.IOPRIO_CLASS_RT
>>> psutil.ionice
2
= Linux implementation =
renice source code:
http://www.kernel.org/pub/linux/utils/util-linux-ng/v2.19/util-linux-2.19-rc1.tar.gz
ioprio_get() and ioprio_set() system calls:
http://linux.die.net/man/2/ioprio_get http://linux.die.net/man/2/ioprio_set =
Other platforms =
FreeBSD (and probably OSX as well) seems not to have this functionnality yet
although it might appear in the future:
http://old.nabble.com/ionice-in-FreeBSD--td27424108.html On Windows this seems
to be possible but only starting from Windows Vista:
http://forum.sysinternals.com/printer_friendly_posts.asp?TID=12767 As for now,
my proposal is to provide this functionnality only on Linux.
On all other platforms Process.nice will just raise an AttributeError exception.
Implemented in r892 .
I decided not to use a property but to split everything in two separate
functions, get_ionice() and set_ionice(), because it must be possible to
differentiate priority class and level (see ionice command).
From g.rodola on January 12, 2011 14:11:22
Original issue: http://code.google.com/p/psutil/issues/detail?id=147
The text was updated successfully, but these errors were encountered: