mysql-5.7 Using asynchronous I/O on Linux

Source: Internet
Author: User

MYSQL-INNODB scenarios where asynchronous IO is used

In general InnoDB only uses asynchronous IO for data files, in order to save logs that are actually written to disk, InnoDB does not enable asynchronous IO for log files

Update in one step, InnoDB only read-ahead the data file, write these two operations enable asynchronous IO

Second, asynchronous IO solves the problem in MySQL:

Before the IO function, InnoDB read and write requests to the data are first placed in the task queue, background read-thread, write-thread from the task queue

Take out tasks and perform read and write operations; The number of background read and write threads can be viewed through the show Engine INNODB status statement

show engine InnoDB status;--------FILEI/O--------I/O thread0State:waiting forI/O Request (Insertbuffer thread) I/O thread1State:waiting forI/O Request (Logthread) I/O thread2State:waiting forI/O Request (Readthread) I/O thread3State:waiting forI/O Request (Readthread) I/O thread4State:waiting forI/O Request (Readthread) I/O thread5State:waiting forI/O Request (Readthread) I/O thread6State:waiting forI/o request (write thread) I/O thread7State:waiting forI/o request (write thread) I/O thread8State:waiting forI/o request (write thread) I/O thread9State:waiting forI/o request (write thread) Pending normal AIO reads:[0, 0, 0, 0], Aio writes:[0, 0, 0, 0], Ibuf Aio reads:,LogI/O's:, sync I/O's:pending Flushes (fsync)Log:0; Buffer pool:0376OSfileReads WuOSfileWrites,7OS Fsyncs41.77Reads/S21886 avgbytes/Read,6.00Writes/S0.78Fsyncs/S

As you can see from the above, InnoDB will have 4 Read-thread and 4 write-thread by default, the problem is here, if the business is heavy, then

Read and write tasks are much more, and InnoDB has only eight read-write threads, so that other read-write requests in the queue do not get a timely response.

  

The introduction of asynchronous IO after the weather, read and write requests are no longer as before in the queue, waiting for the background of the read-write thread to perform the task;

----

mysql-5.7 Using asynchronous I/O on Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.