1IONICE(1)                        User Commands                       IONICE(1)
2
3
4

NAME

6       ionice - set or get process I/O scheduling class and priority
7

SYNOPSIS

9       ionice [-c class] [-n level] [-t] -p PID...
10       ionice [-c class] [-n level] [-t] -P PGID...
11       ionice [-c class] [-n level] [-t] -u UID...
12       ionice [-c class] [-n level] [-t] command [argument...]
13

DESCRIPTION

15       This  program  sets or gets the I/O scheduling class and priority for a
16       program.  If no arguments or just -p is given, ionice  will  query  the
17       current I/O scheduling class and priority for that process.
18
19       When  command  is  given,  ionice  will run this command with the given
20       arguments.  If no class is specified, then  command  will  be  executed
21       with the "best-effort" scheduling class.  The default priority level is
22       4.
23
24       As of this writing, a  process  can  be  in  one  of  three  scheduling
25       classes:
26
27       Idle   A program running with idle I/O priority will only get disk time
28              when no other program has asked for disk I/O for a defined grace
29              period.   The  impact  of  an  idle I/O process on normal system
30              activity should be zero.  This scheduling class does not take  a
31              priority  argument.  Presently, this scheduling class is permit‐
32              ted for an ordinary user (since kernel 2.6.25).
33
34       Best-effort
35              This is the effective scheduling class for any process that  has
36              not  asked for a specific I/O priority.  This class takes a pri‐
37              ority argument from 0-7, with a lower number being higher prior‐
38              ity.   Programs  running  at  the  same best-effort priority are
39              served in a round-robin fashion.
40
41              Note that before kernel 2.6.26 a process that has not asked  for
42              an  I/O  priority  formally uses "none" as scheduling class, but
43              the I/O scheduler will treat such processes as if it were in the
44              best-effort  class.   The  priority within the best-effort class
45              will be dynamically derived from  the  CPU  nice  level  of  the
46              process: io_priority = (cpu_nice + 20) / 5.
47
48              For  kernels  after 2.6.26 with the CFQ I/O scheduler, a process
49              that has not asked for an I/O priority inherits its CPU schedul‐
50              ing  class.  The I/O priority is derived from the CPU nice level
51              of the process (same as before kernel 2.6.26).
52
53
54       Realtime
55              The RT scheduling class is  given  first  access  to  the  disk,
56              regardless  of what else is going on in the system.  Thus the RT
57              class needs to be used with some care, as it  can  starve  other
58              processes.  As with the best-effort class, 8 priority levels are
59              defined denoting how big a  time  slice  a  given  process  will
60              receive on each scheduling window.  This scheduling class is not
61              permitted for an ordinary (i.e., non-root) user.
62

OPTIONS

64       -c, --class class
65              Specify the name or number of the scheduling class to use; 0 for
66              none, 1 for realtime, 2 for best-effort, 3 for idle.
67
68       -n, --classdata level
69              Specify  the  scheduling class data.  This only has an effect if
70              the class accepts an argument.  For  realtime  and  best-effort,
71              0-7 are valid data (priority levels), and 0 represents the high‐
72              est priority level.
73
74       -p, --pid PID...
75              Specify the process IDs of running processes for which to get or
76              set the scheduling parameters.
77
78       -P, --pgid PGID...
79              Specify  the process group IDs of running processes for which to
80              get or set the scheduling parameters.
81
82       -t, --ignore
83              Ignore failure to set the requested priority.   If  command  was
84              specified,  run  it  even in case it was not possible to set the
85              desired scheduling priority, which can happen  due  to  insuffi‐
86              cient privileges or an old kernel version.
87
88       -h, --help
89              Display help text and exit.
90
91       -u, --uid UID...
92              Specify  the  user  IDs of running processes for which to get or
93              set the scheduling parameters.
94
95       -V, --version
96              Display version information and exit.
97

NOTES

99       Linux supports I/O scheduling priorities and classes since 2.6.13  with
100       the CFQ I/O scheduler.
101

EXAMPLES

103       # ionice -c 3 -p 89
104
105       Sets process with PID 89 as an idle I/O process.
106
107       # ionice -c 2 -n 0 bash
108
109       Runs 'bash' as a best-effort program with highest priority.
110
111       # ionice -p 89 91
112
113       Prints the class and priority of the processes with PID 89 and 91.
114

AUTHORS

116       Jens Axboe <jens@axboe.dk>
117       Karel Zak <kzak@redhat.com>
118

SEE ALSO

120       ioprio_set(2)
121

AVAILABILITY

123       The  ionice  command is part of the util-linux package and is available
124       from https://www.kernel.org/pub/linux/utils/util-linux/.
125
126
127
128util-linux                         July 2011                         IONICE(1)
Impressum