Technical dry goods | How to change the I/O scheduler of Linux?

640?wxfrom=5&wx_lazy=1


The Linux I/O scheduler is a process that accesses storage volumes with block I/O, sometimes called the disk scheduler. The working mechanism of the Linux I/O scheduler is to control the request queue of the block device: determine which I/Os in the queue have higher priority and when to issue the I/O to the block device, so as to reduce the disk seek time, thereby reducing the disk seek time. Improve system throughput.

At present, there are several I/O scheduling algorithms on Linux as follows:

1. noop - a device typically used for memory storage.

2. cfq - Fully Fair Scheduler. Processes use IO bandwidth on average.

3. Deadline - For the delay scheduler, each I/O has a latest execution time.

4. Anticipatory - Heuristic scheduling, similar to Deadline algorithm, but introducing prediction mechanism to improve performance.

View the device's current I/O scheduler:

# cat /sys/block//queue/scheduler

Assuming the disk name is /dev/sdc:

# cat /sys/block/sdc/queue/schedulernoop anticipatory deadline [cfq]

How to Change the Hard Disk Device I/O Scheduler

Use the following command:

# echo {SCHEDULER-NAME} > /sys/block//queue/scheduler

For example to set the noop scheduler:

# echo noop > /sys/block/sdc/queue/scheduler

The above settings will be invalid after restarting. If the configuration still takes effect after restarting, you need to write elevator=noop into /boot/grub/menu.lst in the kernel boot parameters:

1. Backup the menu.lst file

cp -p /boot/grub/menu.lst /boot/grub/menu.lst-backup

2. Update /boot/grub/menu.lst

Add elevator=noop to the end of the file, for example:

kernel /vmlinuz-2.6.16.60-0.91.1-smp root=/dev/sysvg/root splash=silent splash=off showopts elevator=noop


Linux cloud computing free courses are hotly launched, 5-day free courses are first to listen, operation and maintenance dry goods content is free to listen, click "read the original text" at the end of the article to listen to the operation and maintenance courses for free ! Hurry up ~~~~

PS: Remember to check the free gift package that Xiaobian sent you~

Welfare | More than 10,000 sets of PPT templates are waiting for you for free! Get it unconditionally!

Free delivery | More than 1000 sets of resume templates are free to get, with a resume making tutorial!

Get it for free | The e-book "100 Cases of Shell Scripts" is free, and it is necessary for operation and maintenance~

640? 640?wx_fmt=jpeg

▼▼Click [ read the original text ] to listen to the 5-day Linux operation and maintenance dry goods sharing class for free . The lecture is in full swing, come and grab it!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324643550&siteId=291194637