6.3. 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 the
noop
scheduler. Thisnoop
scheduler allows the host machine or hypervisor to optimize the input/output requests. Thenoop
scheduler can combine small requests from the guest operating system into larger requests, before handing the I/O to the hypervisor. However,noop
tries to use the fewest number of CPU cycles in the guest for I/O scheduling. The host/hypervisor has an overview of the requests of all guests and uses a separate strategy for handling I/O.Note
For Red Hat Enterprise Linux 7.2 and newer,virtio-blk
always usesnoop
implicitly. This is because it usesblk-mq
. - Depending on the workload I/O and how storage devices are attached, schedulers like
deadline
can be more advantageous. Performance testing is required to verify which scheduler is the best one to use in each situation.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. - Guests using storage accessed by iSCSI, SR-IOV, or physical device passthrough should not use the
noop
scheduler. These methods do not allow the host to optimize I/O requests to the underlying physical device.
In virtualized environments, sometimes it is not beneficial to schedule I/O on both the host and guest layers. If multiple guests use storage on a filesystem 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 and knows the physical layout of storage, which may not map linearly to the guests' virtual storage. On the other hand, depending on the workload, it may be beneficial to use a scheduler like
deadline
in the guest virtual machine.