Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the key feature of Innodb: asynchronous IO

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what is asynchronous IO in the key features of Innodb". In daily operation, I believe that many people have doubts about what the key features of Innodb are asynchronous IO. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what is asynchronous IO in the key features of Innodb?" Next, please follow the editor to study!

1. About AIO and SIO

In order to improve the performance of disk operations, the current database systems use asynchronous IO to deal with disk operations.

1. Asynchronous IO: users can send another IO request immediately after sending another IO request. When all IO requests are sent, wait for all IO operations to be completed. This is AIO.

2. Sync IO corresponds to AIO, that is, every time you perform an IO operation, you need to wait for the end of this operation before continuing the next operation.

2. Enable asynchronous IO

First of all, OS must have asynchronous io and enable it, and then mysqld should be linked, otherwise OS asynchronous io will not be enabled and the asynchronous io of the database will not work. This variable applies to Linux systems only, and cannot be changed while the server is running.

1. This feature needs to be enabled at the file system level: it is generally enabled by default.

Ldconfig-v | grep libaiolibaio.so.1.0.0-> libaio.so.1.0.0libaio.so.1-> libaio.so.1.0.1

2. AIO is a feature at the database level that needs to be enabled: it is enabled by default, but Aliyun is disabled by default. The performance of enabled native aio can be improved to 75%.

Mysql > show variables like 'innodb_use_native_aio' +-+-+ | Variable_name | Value | +-+-+ | innodb_use_native_aio | OFF | | +-+ |

3. Benefits of asynchronous IO

1. You don't have to wait for a direct response to the last user's request

2. Multiple requests are sorted together, and the requested data pages are sorted together, which can be read out at one time and reduce the number of reads. (the read and write request queue of the database is placed in a small memory structure allocated separately in the file system, which is not the cache of the file system.)

4 、 wio:wait io

1. Synchronous IO will definitely generate wait IO

2. Asynchronous IO will reduce wait IO, but there may also be wait IO

3. Try to use asynchronous IO (performance is higher than synchronous IO)

4. Enable asynchronous IO at the database level

5. Enabling asynchronous IO,Linux at the file system level has the ability of asynchronous IO.

6. Understanding the meaning of wio at the operating system level.

At this point, the study on "what are the key features of Innodb asynchronous IO" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report