选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

I/O scheduler for AL2

聚焦模式
I/O scheduler for AL2 - Amazon Linux 2
此页面尚未翻译为您的语言。 请求翻译

The I/O scheduler is a part of the Linux operating system that sorts and merges I/O requests and determines the order in which they are processed.

I/O schedulers are particularly beneficial for devices such as magnetic hard drives, where seek time can be expensive and where it is optimal to merge co-located requests. I/O schedulers have less of an effect with solid state devices and virtualized environments. This is because for solid state devices, sequential and random access don't differ, and for virtualized environments, the host provides its own layer of scheduling.

This topic discusses the Amazon Linux I/O scheduler. For more information about the I/O scheduler used by other Linux distributions, refer to their respective documentation.

Supported schedulers

Amazon Linux supports the following I/O schedulers:

  • deadline — The Deadline I/O scheduler sorts I/O requests and handles them in the most efficient order. It guarantees a start time for each I/O request. It also gives I/O requests that have been pending for too long a higher priority.

  • cfq — The Completely Fair Queueing (CFQ) I/O scheduler attempts to fairly allocate I/O resources between processes. It sorts and inserts I/O requests into per-process queues.

  • noop — The No Operation (noop) I/O scheduler inserts all I/O requests into a FIFO queue and then merges them into a single request. This scheduler does not do any request sorting.

Default scheduler

No Operation (noop) is the default I/O scheduler for Amazon Linux. This scheduler is used for the following reasons:

  • Many instance types use virtualized devices where the underlying host performs scheduling for the instance.

  • Solid state devices are used in many instance types where the benefits of an I/O scheduler have less effect.

  • It is the least invasive I/O scheduler, and it can be customized if needed.

Change the scheduler

Changing the I/O scheduler can increase or decrease performance based on whether the scheduler results in more or fewer I/O requests being completed in a given time. This is largely dependent on your workload, the generation of the instance type that's being used, and the type of device being accessed. If you change the I/O scheduler being used, we recommend that you use a tool, such as iotop, to measure I/O performance and to determine whether the change is beneficial for your use case.

You can view the I/O scheduler for a device using the following command, which uses nvme0n1 as an example. Replace nvme0n1 in the following command with the device listed in /sys/block on your instance.

$ cat /sys/block/nvme0n1/queue/scheduler

To set the I/O scheduler for the device, use the following command.

$ echo cfq|deadline|noop > /sys/block/nvme0n1/queue/scheduler

For example, to set the I/O scheduler for an xvda device from noop to cfq, use the following command.

$ echo cfq > /sys/block/xvda/queue/scheduler

本页内容

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。