1ionice(1) General Commands Manual ionice(1)
2
3
4
6 ionice - get/set program io scheduling class and priority
7
9 ionice [[-c class] [-n classdata] [-t]] -p PID [PID]...
10 ionice [-c class] [-n classdata] [-t] COMMAND [ARG]...
11
13 This program sets or gets the io scheduling class and priority for a
14 program. If no arguments or just -p is given, ionice will query the
15 current io scheduling class and priority for that process.
16
17 As of this writing, a process can be in one of three scheduling
18 classes:
19
20 Idle A program running with idle io priority will only get disk time
21 when no other program has asked for disk io for a defined grace
22 period. The impact of idle io processes on normal system activ‐
23 ity should be zero. This scheduling class does not take a prior‐
24 ity argument. Presently, this scheduling class is permitted for
25 an ordinary user (since kernel 2.6.25).
26
27 Best effort
28 This is the effective scheduling class for any process that has
29 not asked for a specific io priority. This class takes a prior‐
30 ity argument from 0-7, with lower number being higher priority.
31 Programs running at the same best effort priority are served in
32 a round-robin fashion.
33
34 Note that before kernel 2.6.26 a process that has not asked for
35 an io priority formally uses "none" as scheduling class, but the
36 io scheduler will treat such processes as if it were in the best
37 effort class. The priority within the best effort class will be
38 dynamically derived from the cpu nice level of the process:
39 io_priority = (cpu_nice + 20) / 5.
40
41 For kernels after 2.6.26 with CFQ io scheduler a process that
42 has not asked for an io priority inherits CPU scheduling class.
43 The io priority is derived from the cpu nice level of the
44 process (same as before kernel 2.6.26).
45
46
47 Real time
48 The RT scheduling class is given first access to the disk,
49 regardless of what else is going on in the system. Thus the RT
50 class needs to be used with some care, as it can starve other
51 processes. As with the best effort class, 8 priority levels are
52 defined denoting how big a time slice a given process will
53 receive on each scheduling window. This scheduling class is not
54 permitted for an ordinary (i.e., non-root) user.
55
57 -c class
58 The scheduling class name or number. 0 for none, 1 for realtime,
59 2 for best-effort, 3 for idle.
60
61 -n classdata
62 The scheduling class data. This defines the class data, if the
63 class accepts an argument. For real time and best-effort, 0-7 is
64 valid data.
65
66 -p pid Pass in process PID(s) to view or change already running pro‐
67 cesses. If this argument is not given, ionice will run the
68 listed program with the given parameters.
69
70 -t Ignore failure to set requested priority. If COMMAND or PID(s)
71 is specified, run it even in case it was not possible to set
72 desired scheduling priority, what can happen due to insufficient
73 privilegies or old kernel version.
74
76 # ionice -c 3 -p 89
77
78 Sets process with PID 89 as an idle io process.
79
80 # ionice -c 2 -n 0 bash
81
82 Runs 'bash' as a best-effort program with highest priority.
83
84 # ionice -p 89 91
85
86 Prints the class and priority of the processes with PID 89 and 91.
87
89 Linux supports io scheduling priorities and classes since 2.6.13 with
90 the CFQ io scheduler.
91
93 Jens Axboe <jens@axboe.dk>
94
96 The ionice command is part of the util-linux-ng package and is avail‐
97 able from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
98
99
100
101ionice August 2005 ionice(1)