1 .TH ionice "1" "August 2005" ionice
3 ionice \- get/set program io scheduling class and priority
5 .BI "ionice [[\-c " class "] [\-n " classdata " ] [\-t]] \-p " PID " [" PID " ...]"
7 .BI "ionice [\-c " class "] [\-n " classdata " ] [\-t] COMMAND [ARG ...]"
10 This program sets or gets the io scheduling class and priority for a program.
11 If no arguments or just \fI-p\fR is given, \fIionice\fR will query the current
12 io scheduling class and priority for that process.
14 As of this writing, a process can be in one of four scheduling classes:
17 A program running with idle io priority will only get disk time when no other
18 program has asked for disk io for a defined grace period. The impact of idle
19 io processes on normal system activity should be zero. This scheduling
20 class does not take a priority argument. Presently, this scheduling class
21 is permitted for an ordinary user (since kernel 2.6.25).
23 .IP "\fBBest effort\fP"
24 This is the effective scheduling class for any process that hasn't asked for
25 a specific io priority.
26 This class takes a priority argument from \fI0-7\fR, with lower
27 number being higher priority. Programs running at the same best effort
28 priority are served in a round-robin fashion.
31 The RT scheduling class is given first access to the disk, regardless of
32 what else is going on in the system. Thus the RT class needs to be used with
33 some care, as it can starve other processes. As with the best effort class,
34 8 priority levels are defined denoting how big a time slice a given process
35 will receive on each scheduling window. This scheduling class is not
36 permitted for an ordinary (i.e., non-root) user.
39 A process that that hasn't asked for a specific io priority will formally be
40 in this class. The io scheduler will treat a process that is in this class as
41 if it were in the best effort class. The priority within the best effort
42 class will be dynamically derived from the cpu nice level of the process:
43 io_priority = (cpu_nice + 20) / 5
47 .IP "\fB-c \fIclass\fP"
48 The scheduling class. \fI1\fR for real time, \fI2\fR for best-effort, \fI3\fR for idle.
49 .IP "\fB-n \fIclassdata\fP"
50 The scheduling class data. This defines the class data, if the class
51 accepts an argument. For real time and best-effort, \fI0-7\fR is valid
54 Pass in process PID(s) to view or change already running processes. If this argument
55 is not given, \fBionice\fP will run the listed program with the given
58 Ignore failure to set requested priority. If COMMAND or PID(s) is specified, run it
59 even in case it was not possible to set desired scheduling priority, what
60 can happen due to insufficient privilegies or old kernel version.
65 # \fBionice\fP -c 3 -p 89
67 Sets process with PID 89 as an idle io process.
69 # \fBionice\fP -c 2 -n 0 bash
71 Runs 'bash' as a best-effort program with highest priority.
73 # \fBionice\fP -p 89 91
75 Prints the class and priority of the processes with PID 89 and 91.
78 Linux supports io scheduling priorities and classes since 2.6.13 with the CFQ
82 Jens Axboe <axboe@suse.de>
85 The ionice command is part of the util-linux-ng package and is available from
86 ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.