LINUX IO scheduling Policy

Source: Internet
Author: User
Tags dmesg

IoScheduling Policy

IO scheduling strategy generally has btrfs Cfq,noop, Deadline three kinds of

Appendix:

The overall goal of the IO Scheduler is to keep the head moving in one Direction , moving to the opposite direction , which is exactly the elevator model in real life , so the IO Scheduler is also called an elevator. . (elevator) and the corresponding algorithm is called elevator algorithm . and There are several types of elevator algorithms for IO scheduling in Linux, one called as (anticipatory), and one called CFQ (complete fairness Queueing), one called deadline, and one called noop (nooperation). we can specify which algorithm to use in the kernel parameter elevator at boot time .

a) I/OScheduling of4kinds of Algorithms1) CFQ (perfectly Fair line/ oDispatch Program)

features :

in the latest kernel version and release , CFQ is chosen as the default I/O scheduler , which is also the best choice for a common server .

CFQ attempts to evenly distribute access to I/O bandwidth , avoiding starvation of processes and achieving lower latencies , deadline and as The compromise of the scheduler .

CFQ is the best choice for multimedia Applications (Video,audio) and desktop systems.

CFQ give I/O requests a priority , and I/O priority requests are independent of the process priority , and Read and write of high-priority processes cannot automatically inherit high I/O priorities .

Working principle :

CFQ creates a separate queue for each process / thread to manage the requests generated by the process , i.e. one queue per process , scheduling between queues using time slices ,

This ensures that each process is well allocated to I/O bandwidth . The I/O Scheduler executes 4 requests per process at a time .

2) NOOP (Elevator Type Dispatch program)

features :

in the Linux2.4 or an earlier version of the scheduler , Then there was only one I/O scheduling algorithm .

The NOOP implements a simple FIFO queue that organizes I/O requests like an elevator's working master , and when a new request arrives , It consolidates the request after the most recent request , ensuring that the same media is requested .

NOOP tends to starve to read while writing .

NOOP is the best choice for flash memory devices , RAM, and embedded systems.

The elevator algorithm starved read request explanation :

because writing requests is easier than reading requests .

write requests through the file system cache, do not have to wait a write completion , You can start the next write Operation , write requests by merging , piled up into the I/O queue .

The read request needs to wait until all of the read operations in front of it have completed before the next read Operation . There are a few milliseconds between read operations , and the write request comes in between , starving the subsequent read request .

3) Deadline (Deadline Scheduler)

features :

This classification and merging requirements are similar to the NoOp scheduler , which is categorized by time and hard drive area .

Deadline ensures that a service request is made within a cutoff time , which is adjustable and the default read period is shorter than the write period . This prevents the write operation from starving to death because it cannot be read .

Deadline is the best choice for the database environment (Oraclerac,mysql , etc. ).

4) AS (anticipate/ oDispatch Program)

features :

essentially with Deadline , but after the last read operation , wait for 6ms to continue scheduling other I/O requests .

you can subscribe to a new read request from the application to improve the execution of the read Operation , but at the expense of some write operations .

it inserts new I/O operations into each 6ms, while some small write streams are combined into an uppercase stream , with write latencies for maximum write throughput .

As is suitable for writing more environments , such as file servers

As has a poor performance on the database environment .

two)ModifyIoScheduling Algorithm

view current system-supported IO Scheduling Algorithm

DMESG | Grep-i Scheduler

[Email protected] ~]# DMESG | Grep-ischeduler

IO Scheduler NoOp Registered

IO Scheduler anticipatory registered

IO Scheduler deadline registered

IO Scheduler CFQ registered (default)

View the current system's I/O scheduling method :

Cat/sys/block/sda/queue/scheduler

NoOp anticipatory deadline [CFQ]

change to a pro I/O scheduling method :

For example : to change to noop elevator scheduling algorithm :

Echo NoOp >/sys/block/sda/queue/scheduler


want a permanent change I/O scheduling method :

Modify Kernel boot parameters , add elevator= Scheduler name

Vi/boot/grub/menu.lst

change to the following :

Kernel/boot/vmlinuz-2.6.18-8.el5 roroot=label=/elevator=deadline RHGB quiet

after rebooting, review the scheduling method :

Cat/sys/block/sda/queue/scheduler

NoOp anticipatory [deadline] Cfq

It's already deadline .


This article is from the "Life" blog, please be sure to keep this source http://153022.blog.51cto.com/143022/1918869

LINUX IO scheduling Policy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.