In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
It is believed that many inexperienced people have no idea about how to adjust the disk IO scheduling algorithm in MySQL database. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
View the disk IO scheduling algorithms supported by the current system
[root@alpha-mongo-140-52 ~] # dmesg | grep-I scheduler
Io scheduler noop registered
Io scheduler anticipatory registered
Io scheduler deadline registered
Io scheduler cfq registered (default)
Default represents the default IO scheduling algorithm used by the current device
You can also view it with the following command:
[root@test ~] # more / sys/block/sda/queue/scheduler
Noop anticipatory deadline [cfq]
Note: the value of the current scheduling algorithm enclosed in parentheses
Modify the io scheduling algorithm used by the current block device to deadline:
[root@test ~] # echo "deadline" > / sys/block/sda/queue/scheduler
Remarks: the modification will take effect immediately.
[root@test ~] # more / sys/block/sda/queue/scheduler
Noop anticipatory [deadline] cfq
Scheduling algorithm introduction:
Linux has four IO scheduling algorithms, namely, fully Fair queuing algorithm (Complete Fair Queuing/CFQ), NOOP algorithm (No Operation), deadline algorithm (Deadline) and expectation algorithm (anticipatory).
The full queue fairness algorithm puts the disk Iram O request into the corresponding queue of the process according to the process. The fairness of CFQ is for processes. Each process that submits a request has its own IO O queue. Based on the time slice algorithm, CFQ takes turns to transfer the queue. By default, four requests are taken out of the current queue to be processed, and then four requests in the next queue are processed to ensure that each process enjoys a balanced share of IGO resources. CFQ is Linux's default Imax O scheduling algorithm.
The NOOP algorithm does not sort the Imax O requests and does not make any other optimization except for merging requests. The NOOP algorithm is mainly aimed at random IO access devices such as SSD, which is submitted in the simplest FIFO queue order.
In addition to maintaining a request queue with merging and sorting functions, the deadline algorithm (Deadline) maintains two additional queues, namely, the read request queue and the write request queue, both of which are request queues with timeouts. When a new IO request comes, it will be inserted into the normal queue and the read-write queue at the same time. When the scheduler finds that the requests in the read-write request queue time out, it will give priority to these requests to ensure that hunger requests are not generated as much as possible. For MYSQL, it is recommended to set it to Deadline, which is a good scheduling algorithm for MYSQL.
Expectation algorithm (anticipatory) is a prediction-based IPUP O algorithm, which, like Deadline, also maintains three request queues. The difference is that after processing one IO request, the expectation algorithm will not directly return to process the next request, but wait for 6 seconds by default. During the waiting period, if there is a request from a new adjacent sector, it will directly process the new request. After waiting for 6 seconds, the scheduling will return to process the next queue request. Anticipatory is suitable for the environment with more writes and less reads, but it is not suitable for database environments with more random reads such as MySQL.
After reading the above, have you mastered the method of how to adjust the disk IO scheduling algorithm in MySQL database? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.