How to set a permanent I/O scheduler on one or more specific devices using tuned

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL) 9
  • Red Hat Enterprise Linux (RHEL) 8
  • Red Hat Enterprise Linux (RHEL) 7

Issue

  • How do I set IO scheduler on a specific device permanently?
  • The article How to use the Noop IO Scheduler describes the way to set permanent IO scheduler on all devices, but I need it for a specific device only this time.

Resolution

Like all things linux, there are several ways in which a permanent I/O scheduler can be assigned to one or more particular devices. Using Tuned or UDEV rules are but two choices to accomplish the same task.

Using a customized tuned profile

  1. Create /etc/tuned/myprofile directory:

     # mkdir /etc/tuned/myprofile
    
  2. Create /etc/tuned/myprofile/tuned.conf with the following entries:

     # vi /etc/tuned/myprofile/tuned.conf
     [main]
     include=throughput-performance
             
      [disk]
     devices=sda
     elevator=noop
    
     //sda is the device you wish to set noop IO scheduler on. When using multipath devices, only the scheduler of the DM device (i.e. dm-X) is applicable and takes effect.
    
  3. Make the setting take effect:

     # tuned-adm profile myprofile
    
  4. Check if the setting is kept permanently:

     # reboot
     # cat /sys/block/sda/queue/scheduler 
     [noop] deadline cfq 
    

More details at:

SBR
Components

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.