官术网_书友最值得收藏!

Disk tuning parameters

In this recipe, we will be discussing a few disk I/O related schedulers that are designed for a specific need.

Getting ready

The Linux kernel provides various device-specific algorithms, which give more flexibility in fine tuning the hardware devices. The Linux kernel by default provides several I/O scheduling algorithms, which have their own unique usages. Kernel also provides a way to change different I/O scheduling policies for different disk devices. The major disk I/O schedulers are CFQ (Completely Fair Queuing), noop, and deadline.

How to do it...

Let us discuss about, the Linux disk scheduling algorithms:

CFQ

This is the default I/O scheduler that we get for the disk devices. This scheduler provides I/O time slices, like the CPU scheduler. This algorithm also considers the I/O priorities by reading the process's ionice values, and also allots scheduling classes such as real time, best effort, and idle classes. An advantage of this scheduler is it tries to analyze the historical data of the I/O requests and will predict the process near future I/O requirements. If it is expected that a process will issue more I/O than it waits for it, rather processing the other waiting I/O process. Sometimes this I/O prediction may go bad, which leads to a bad disk throughput. However, CFQ provides a tunable parameter, slice_idle, which controls the amount of waiting time for the predicted I/O requests. It is always recommended to set this value to 0 for the RAID disk devices, and any positive integer setting for non-RAID devices.

noop

This I/O scheduler is pretty neat, as it doesn't include any restrictions such as time slices in CFQ and sends the request to the disk in FIFO order. This I/O scheduler works much more and gives more performance when the underlying disk devices are of a RAID or SSD type. This is because devices such as RAID or SSD follow their own unique techniques while reordering I/O requests.

Deadline

This I/O scheduler is widely used for all database servers, since it enforces the latency limits over all I/O requests. By using this scheduler, we can achieve good performance for the database server, which has more read operations than write operations. This algorithm dispatches the I/O tasks as batches. A single batch contains a set of read/write operations along with their expire timings. We can tune the batch size and expire timings of each read, write using the following parameters:

How it works...

As we discussed previously, each I/O request will be processed based on a unique I/O scheduler, which will try to rearrange the requests in a physical order to reduce the mechanical overhead while reading the data from the disk.

主站蜘蛛池模板: 湾仔区| 永州市| 喀喇沁旗| 罗源县| 昌邑市| 宣恩县| 安福县| 通山县| 台安县| 望奎县| 紫云| 平远县| 嫩江县| 墨脱县| 资溪县| 手游| 石门县| 达拉特旗| 大渡口区| 疏勒县| 抚州市| 西畴县| 樟树市| 建平县| 桑植县| 会泽县| 温宿县| 新河县| 长葛市| 天峨县| 文山县| 杂多县| 五家渠市| 托克逊县| 玉门市| 尖扎县| 屏东市| 宁晋县| 应城市| 游戏| 怀仁县|