1IONICE(1) User Commands IONICE(1)
2
3
4
6 ionice - set or get process I/O scheduling class and priority
7
9 ionice [-c class] [-n level] [-t] -p PID
10
11 ionice [-c class] [-n level] [-t] -P PGID
12
13 ionice [-c class] [-n level] [-t] -u UID
14
15 ionice [-c class] [-n level] [-t] command [argument] ...
16
18 This program sets or gets the I/O scheduling class and priority for a
19 program. If no arguments or just -p is given, ionice will query the
20 current I/O scheduling class and priority for that process.
21
22 When command is given, ionice will run this command with the given
23 arguments. If no class is specified, then command will be executed with
24 the "best-effort" scheduling class. The default priority level is 4.
25
26 As of this writing, a process can be in one of three scheduling
27 classes:
28
29 Idle
30 A program running with idle I/O priority will only get disk time
31 when no other program has asked for disk I/O for a defined grace
32 period. The impact of an idle I/O process on normal system activity
33 should be zero. This scheduling class does not take a priority
34 argument. Presently, this scheduling class is permitted for an
35 ordinary user (since kernel 2.6.25).
36
37 Best-effort
38 This is the effective scheduling class for any process that has not
39 asked for a specific I/O priority. This class takes a priority
40 argument from 0-7, with a lower number being higher priority.
41 Programs running at the same best-effort priority are served in a
42 round-robin fashion.
43
44 Note that before kernel 2.6.26 a process that has not asked for an
45 I/O priority formally uses "none" as scheduling class, but the I/O
46 scheduler will treat such processes as if it were in the
47 best-effort class. The priority within the best-effort class will
48 be dynamically derived from the CPU nice level of the process:
49 io_priority = (cpu_nice + 20) / 5.
50
51 For kernels after 2.6.26 with the CFQ I/O scheduler, a process that
52 has not asked for an I/O priority inherits its CPU scheduling
53 class. The I/O priority is derived from the CPU nice level of the
54 process (same as before kernel 2.6.26).
55
56 Realtime
57 The RT scheduling class is given first access to the disk,
58 regardless of what else is going on in the system. Thus the RT
59 class needs to be used with some care, as it can starve other
60 processes. As with the best-effort class, 8 priority levels are
61 defined denoting how big a time slice a given process will receive
62 on each scheduling window. This scheduling class is not permitted
63 for an ordinary (i.e., non-root) user.
64
66 -c, --class class
67 Specify the name or number of the scheduling class to use; 0 for
68 none, 1 for realtime, 2 for best-effort, 3 for idle.
69
70 -n, --classdata level
71 Specify the scheduling class data. This only has an effect if the
72 class accepts an argument. For realtime and best-effort, 0-7 are
73 valid data (priority levels), and 0 represents the highest priority
74 level.
75
76 -p, --pid PID...
77 Specify the process IDs of running processes for which to get or
78 set the scheduling parameters.
79
80 -P, --pgid PGID...
81 Specify the process group IDs of running processes for which to get
82 or set the scheduling parameters.
83
84 -t, --ignore
85 Ignore failure to set the requested priority. If command was
86 specified, run it even in case it was not possible to set the
87 desired scheduling priority, which can happen due to insufficient
88 privileges or an old kernel version.
89
90 -u, --uid UID...
91 Specify the user IDs of running processes for which to get or set
92 the scheduling parameters.
93
94 -h, --help
95 Display help text and exit.
96
97 -V, --version
98 Print version and exit.
99
101 Linux supports I/O scheduling priorities and classes since 2.6.13 with
102 the CFQ I/O scheduler.
103
105 • # ionice -c 3 -p 89
106
107 Sets process with PID 89 as an idle I/O process.
108
109 • # ionice -c 2 -n 0 bash
110
111 Runs 'bash' as a best-effort program with highest priority.
112
113 • # ionice -p 89 91
114
115 Prints the class and priority of the processes with PID 89 and 91.
116
118 Jens Axboe <jens@axboe.dk>, Karel Zak <kzak@redhat.com>
119
121 ioprio_set(2)
122
124 For bug reports, use the issue tracker at
125 https://github.com/util-linux/util-linux/issues.
126
128 The ionice command is part of the util-linux package which can be
129 downloaded from Linux Kernel Archive
130 <https://www.kernel.org/pub/linux/utils/util-linux/>.
131
132
133
134util-linux 2.39.2 2023-06-14 IONICE(1)