Chapter 3. Setting the disk scheduler


The disk scheduler is responsible for ordering the I/O requests submitted to a storage device. You can configure the scheduler in several different ways:

  • Set the scheduler using TuneD.
  • Set the scheduler using udev.
  • Temporarily change the scheduler on a running system.
Note

In Red Hat Enterprise Linux, block devices support only multi-queue scheduling. This enables the block layer performance to scale well with fast solid-state drives (SSDs) and multi-core systems.

3.1. Available disk schedulers

Choosing the appropriate disk scheduler significantly impacts system performance, responsiveness, and the efficiency of I/O operations. Evaluate each scheduler’s characteristics to select the most suitable option for your specific workload and hardware.

The following multi-queue disk schedulers are supported in Red Hat Enterprise Linux:

none
Implements a first-in first-out (FIFO) scheduling algorithm. It merges requests at the generic block layer through a simple last-hit cache.
mq-deadline

Attempts to provide a guaranteed latency for requests from the point, at which requests reach the scheduler. The mq-deadline scheduler sorts queued I/O requests into a read or write batch. Later, it schedules them in an increasing logical block addressing (LBA) order. By default, read batches take precedence over write batches, because applications get block on read I/O operations. After processing a batch, mq-deadline checks for write starvation. It then schedules the next read or write batch accordingly.

This scheduler is suitable for most use cases, but particularly those in which write operations are mostly asynchronous.

bfq

Targets desktop systems and interactive tasks. The bfq scheduler ensures that a single application is never using all of the bandwidth. In effect, the storage device is always as responsive as if it was idle. In its default configuration, bfq focuses on delivering the lowest latency rather than achieving the maximum throughput.

bfq is based on cfq code. The scheduler assigns a budget of sectors to each process instead of granting a fixed time slice of disk access. This scheduler is suitable when copying large files do not make the system unresponsive.

kyber
The scheduler achieves a latency goal by calculating the latency of every request in the block I/O layer. You can configure the target latencies for read, in the case of cache-misses, and synchronous write requests. This scheduler is suitable for fast devices, for example NVMe, SSD, or other low latency devices.
Default disk scheduler
Block devices use the default disk scheduler unless you specify another scheduler.
Note

For non-volatile Memory Express (NVMe) block devices specifically, the default scheduler is none and Red Hat recommends not changing this.

The kernel selects a default disk scheduler based on the type of device. The automatically selected scheduler is typically the optimal setting. If you require a different scheduler, use udev rules or the TuneD application to configure it. Match the selected devices and switch the scheduler only for those devices.

Use these disk schedulers as a starting point before performing analysis and tuning.

Expand
Table 3.1. Disk scheduler recommendations by use case
Use caseDisk scheduler

Traditional HDD with a SCSI interface

Use mq-deadline or bfq.

High-performance SSD or a CPU-bound system with fast storage

Use none, especially when running enterprise applications. Alternatively, use kyber.

Desktop or interactive tasks

Use bfq.

Virtual guest

Use mq-deadline. With a host bus adapter (HBA) driver that is multi-queue capable, use none.

3.3. Determining the active disk scheduler

You can view the disk scheduler that is currently active on a given block device.

Procedure

  • Read the content of the /sys/block/device/queue/scheduler file:

    # cat /sys/block/device/queue/scheduler
    [mq-deadline] kyber bfq none

    In the file name, replace device with the block device name, for example sdc. The active scheduler is listed in square brackets ([ ]).

3.4. Setting the disk scheduler using TuneD

You can create and enable a TuneD profile that sets a given disk scheduler for selected block devices. The setting persists across system reboots. In the following commands and configuration, replace:

  • device with the name of the block device, for example sdf and
  • selected-scheduler with the disk scheduler that you want to set for the device, for example bfq.

Prerequisites

Procedure

  1. Optional: Select an existing TuneD profile on which your profile will be based. For a list of available profiles, see TuneD profiles distributed with RHEL.
  2. To see which profile is currently active, use:

    # tuned-adm active
  3. Create a new directory to hold your TuneD profile:

    # mkdir /etc/tuned/<new-profile>
  4. Find the system unique identifier of the selected block device:

    # udevadm info --query=property --name=/dev/device | grep -E '(WWN|SERIAL)'
    ID_WWN=0x5002538d00000000_
    ID_SERIAL=Generic-_SD_MMC_20120501030900000-0:0
    ID_SERIAL_SHORT=20120501030900000
    Note

    This command returns all values identified as a World Wide Name (WWN) or serial number associated with the specified block device. Although using a WWN is preferred, it is not always available for every device. In such cases, you can use any value returned by the example command as the device system’s unique ID.

  5. Create the /etc/tuned/my-profile/tuned.conf configuration file. In the file, set the following options:

    1. Optional: Include an existing profile:

      [main]
      include=<existing-profile>
    2. Set the selected disk scheduler for the device that matches the WWN identifier:

      [disk]
      devices_udev_regex=IDNAME=device system unique id
      elevator=selected-scheduler

      Here:

      • Replace IDNAME with the name of the identifier being used (for example, ID_WWN).
      • Replace device system unique id with the value of the chosen identifier (for example, 0x5002538d00000000). To match multiple devices in the devices_udev_regex option, enclose the identifiers in parentheses and separate them with vertical bars:

        devices_udev_regex=(ID_WWN=0x5002538d00000000)|(ID_WWN=0x1234567800000000)
  6. Enable your profile:

    # tuned-adm profile <new-profile>

Verification

  1. Verify that the TuneD profile is active and applied:

    $ tuned-adm active
    Current active profile: <profile>
    $ tuned-adm verify
    Verification succeeded, current system settings match the preset profile.
    See TuneD log file ('/var/log/tuned/tuned.log') for details.
  2. Read the contents of the /sys/block/device/queue/scheduler file:

    $ cat /sys/block/device/queue/scheduler
    [mq-deadline] kyber bfq none

    In the file name, replace device with the block device name, for example sdc. The active scheduler is listed in square brackets ([]).

3.5. Setting the disk scheduler using udev rules

You can set a given disk scheduler for specific block devices by using the udev rules. The setting persists across system reboots. In the following commands and configuration, replace:

  • device with the name of the block device, for example sdf and
  • selected-scheduler with the disk scheduler that you want to set for the device, for example bfq.

Procedure

  1. Find the system unique identifier of the block device:

    # $ udevadm info --name=/dev/device | grep -E '(WWN|SERIAL)'
    E: ID_WWN=0x5002538d00000000
    E: ID_SERIAL=Generic-_SD_MMC_20120501030900000-0:0
    E: ID_SERIAL_SHORT=20120501030900000
    Note

    This command returns all values identified as a World Wide Name (WWN) or serial number associated with the specified block device. Although using a WWN is preferred, it is not always available for every device. In such cases, you can use any value returned by the example command as the device system’s unique ID.

  2. To configure the udev rule, create the /etc/udev/rules.d/99-scheduler.rules file with the following content:

    ACTION=="add|change", SUBSYSTEM=="block", ENV{IDNAME}=="device system unique id", ATTR{queue/scheduler}="selected-scheduler"

    Here:

    • Replace IDNAME with the name of the identifier being used (for example, ID_WWN).
    • Replace device system unique id with the value of the chosen identifier (for example, 0x5002538d00000000).
  3. Reload udev rules:

    # udevadm control --reload-rules
  4. Apply the scheduler configuration:

    # udevadm trigger --type=devices --action=change

Verification

  • Verify the active scheduler:

    # cat /sys/block/device/queue/scheduler

You can set a given disk scheduler for specific block devices. The setting does not persist across system reboots.

Procedure

  • Write the name of the selected scheduler to the /sys/block/device/queue/scheduler file:

    # echo selected-scheduler > /sys/block/device/queue/scheduler

    In the file name, replace device with the block device name, for example sdc.

Verification

  • Verify that the scheduler is active on the device.

    # cat /sys/block/device/queue/scheduler
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top