6.2. I/O Scheduling with Red Hat Enterprise Linux as a Virtualization Guest
You can use I/O scheduling on a Red Hat Enterprise Linux guest virtual machine, regardless of the hypervisor on which the guest is running. The following is a list of benefits and issues that should be considered:
- Red Hat Enterprise Linux guests often benefit greatly from using the
noopscheduler. The scheduler merges small requests from the guest operating system into larger requests before sending the I/O to the hypervisor. This enables the hypervisor to process the I/O requests more efficiently, which can significantly improve the guest's I/O performance.
- Depending on the workload I/O and how storage devices are attached, schedulers like
deadlinecan be more beneficial than
noop. Red Hat recommends performance testing to verify which scheduler offers the best performance impact.
- Guests that use storage accessed by iSCSI, SR-IOV, or physical device passthrough should not use the
noopscheduler. These methods do not allow the host to optimize I/O requests to the underlying physical device.
In virtualized environments, it is sometimes not beneficial to schedule I/O on both the host and guest layers. If multiple guests use storage on a file system or block device managed by the host operating system, the host may be able to schedule I/O more efficiently because it is aware of requests from all guests. In addition, the host knows the physical layout of storage, which may not map linearly to the guests' virtual storage.
All scheduler tuning should be tested under normal operating conditions, as synthetic benchmarks typically do not accurately compare performance of systems using shared resources in virtual environments.
6.2.1. Configuring the I/O Scheduler for Red Hat Enterprise Linux 7
The default scheduler used on a Red Hat Enterprise Linux 7 system is
deadline. However, on a Red Hat Enterprise Linux 7 guest machine, it may be beneficial to change the scheduler to
noop, by doing the following:
- In the
/etc/default/grubfile, change the
elevator=deadlinestring on the
elevator=noop. If there is no
elevator=noopat the end of the line.The following shows the
/etc/default/grubfile after a successful change.
cat /etc/default/grub[...] GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=vg00/lvroot rhgb quiet elevator=noop" [...]
- Rebuild the
- On a BIOS-based machine:
grub2-mkconfig -o /boot/grub2/grub.cfg
- On an UEFI-based machine:
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg