ionice linux utility – I/O scheduling class & priority for a program or script
Ionice linux command provide more control as compare to nice command. This program sets the I/O scheduling class & priority for a program or script. It supports following three scheduling classes:
- Idle : A program running with idle I/O priority will only get disk time when no other program has asked for disk io for a defined grace period. The impact of idle io processes on normal system activity should be zero. Idle scheduling class does not take a priority argument.
- Best effort : This is the default scheduling class for any process that hasn’t asked for a specific io priority. Programs inherit the CPU nice setting for io priorities. This class takes a priority argument from 0-7, with lower number being higher priority. Programs running at the same best effort priority are served in a round-robin fashion. This option is usually recommended for most application.
- Real time : The RT scheduling class is given first access to the disk, regardless of what else is going on in the system. Thus the RT class needs to be used with some care, as it can starve other processes. As with the best effort class, 8 priority levels are defined denoting how big a time slice a given process will receive on each scheduling window. RT class should be avoided for all heavily loaded system.
The scheduling class using following number system & priorities:
(Scheduling class , Number , Possible priority)
- real time – 1
8 priority levels are defined denoting how big a time slice a given process will receive on each scheduling window - best-effort – 2
0-7, with lower number being higher priority - idle – 3
Nil ( does not take a priority argument)
To display the class and priority of the running process, enter:
# ionice -p {PID}
You can set process with PID 1000 as an idle io process, enter:
# ionice -c3 -p 1000
Dump full web server disk / mysql backup using best effort scheduling (2) and 6 priority:
# /usr/bin/ionice -c2 -n6 /root/scripts/nas.backup.full
you can combine both nice & ionice together:
# nice -n 19 ionice -c2 -n5 /path/to/shell.script
Categories: Linux, Tech io priority, io scheduling, ionice, ionice command, linux command, mysql backup, nice command, round-robin








