In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Linux is a multi-user, multi-task, multi-thread and multi-CPU operating system based on POSIX and Unix, which has the characteristics of free use and free transmission. With the development of open source software and the innovation of cloud computing technology, Linux has become one of the skills that cloud computing talents must master. The following is to share with you the content of the cloud computing learning roadmap courseware: Linux performance optimization IO subsystem.
Many students have heard of IO stream, that is, input and output in the way of stream, in which stream is an abstract concept, which represents the unstructured transmission of data. IO system, whose full name is "Input output system" in English and "input and output system" in Chinese, is composed of input and output control system and peripheral equipment. It is an important part of computer system.
As a Linux server, the two largest IO types are disk IO and network IO. A complete IO system process is as follows:
1) A user process initiates a write request through the write () system call
2) page cache corresponding to kernel update
3) pdflush kernel thread writes page cache to disk
4) the file system layer stores each block buffer as a bio structure and submits a write request to the block device layer
5) the block device layer receives the request from the upper layer, performs the IO scheduling operation, and puts the request into the IO request queue
6) device drivers (such as SCSI or other device drivers) complete write operations
7) the firmware of the disk device performs the corresponding hardware operations, such as disk rotation, seek, etc., and the data is written to the disk sector.
Block layer processes bio requests and links them into a queue called the IO request queue, which is called IO scheduling (also known as IO elevator, the elevator algorithm). The bio structure is the interface from file system layer to block layer.
The overall goal of IO scheduler is to reduce disk seek time (so the scheduler is optimized for mechanical hard drives), and IO scheduler reduces disk seek in two ways: merge and sort.
Merging means that when two or more IO requests are adjacent disk sectors, by merging requests, multiple IO requests only need to send a request instruction to the disk, reducing the disk overhead.
Sorting is to sort the unmerged IO requests in the request queue according to the order of the disk sectors of the request, so that the magnetic head can complete the IO operation according to the rotation order of the disk, which can reduce the number of disk seek.
To optimize IO system performance, we can use the following ways:
1) to adjust buffer and improve performance is to adjust the number of queues and increase pre-readings.
Increase queue length: / sys/block/vda (specific device) / queue/nr_requests
Increase pre-readings: / sys/block/vda (specific device) / queue/read_ahead_kb
2) modify CFQ to adjust its performance, involving the parameter file: / sys/block/vda/queue/iosched/.
For example, for CFQ, there are several values that can be adjusted:
Back_seek_max
Reverse seek may have negative effects, which can be enabled when the load is low, otherwise do not use too many values.
Back_seek_penal
Reverse seek as a punishment, if you have to use reverse seek, then it must be punished, once the punishment is done, you must seek forward more times.
Fifo_expire_async
It is used to control the waiting time of asynchronous requests, which defaults to 250 milliseconds. Asynchronous requests that cannot be satisfied after expiration will be moved to the scheduling queue, which means rescheduling. Usually these values do not need to be adjusted.
In addition to the above methods, there are many other ways to optimize IO. The general idea is that it is best to change the SSD, adjust the raid level, select the IO scheduler, select the appropriate file system according to the scene, configure the parameters of the selected scheduler, and use tools to analyze whether the optimization result is ideal, which is written in the boot item.
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.