Home Technical Articles Ionice Command: Set I/O Scheduling Class and Priority

Ionice Command: Set I/O Scheduling Class and Priority

by SupportPRO Admin

The ionice command is used to set I/O scheduling class and priority for a program.

The I/O schedule for a program can be changed to the following:

  1. CFQ
  2. Noop scheduler
  3. Anticipatory
  4. Deadline

The current Disk Scheduler can be viewed from

root@twenty ~]# cat /sys/block/sd[ab]/queue/scheduler
noop anticipatory deadline [cfq]

The current scheduler can be changed by

[root@twenty queue]# echo anticipatory> scheduler
[root@twenty queue]# cat /sys/block/sda/queue/scheduler
noop [anticipatory] deadline cfq

Ionice Utility

The ionice sets the io scheduling class and priority for a program or script. It supports the following three scheduling classes

  1. Idle: A program running with idle io priority will only get disk time when no other program has asked for disk io for a defined grace period. Number-3
  2. 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 a lower number being a higher priority. Number- 2
  3. 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. Number -1

Setting ionice for a pid ( number 3 specifies the scheduling class)

ionice -c3 -p 1004

If you require help, contact SupportPRO Server Admin

guy server checkup

Need help with your servers?

Contact Us today!

Leave a Comment


Sales and Support

Phone: 1-(847) 607-6123
Fax: 1-(847)-620-0626
Sales: sales@supportpro.com
Support: clients@supportpro.com
Skype ID: sales_supportpro

Postal Address

1020 Milwaukee Ave, #245,
Deerfield, IL-60015

©2022  SupportPRO.com. All Rights Reserved