mysql-5.7 InnoDB's parallel task scheduling detailed

Source: Internet
Author: User

One, InnoDB parallel task scheduling is what:

Here to "archaeology", otherwise the problem is not clear. When I was in college, the teacher told us that the first computer had only one core, and that one thing could only be done at a time,

If you have two things to use on the computer, the next thing can only wait until the first thing is done. Later on, the computer evolved, and the computer no longer

is to do one thing is done, and then to do the second thing, but a matter only to do a very short time, do not care whether the matter has been finished, it will do the second piece

, and the second thing only takes a very short time, and goes back to do the first thing;

Although the fact that two things are staggered, because the first thing is only a very short period of time, so the overall look, two things are at the same time have made progress

One of the words used above, "a very short time", is a "time slice" for a professional point, which means that each task will only be on the computer (CPU)

A time slice so long, will be interrupted, the computational power to other tasks, the above example in order to facilitate the explanation we just gave two tasks, in fact, multiple tasks

And that's it. A task executes for a period of time and executes the next task.

The evolution of the computer has not yet ended, and later the CPU is not just a core, but a plurality of cores, so that the computer can have a higher degree of parallelism, the task of the tune

degree algorithm or according to the time slice of that set, this also from the side of this algorithm is now more good and reliable.

InnoDB task scheduling and the above-mentioned CPU task scheduling is the same in the design thinking, InnoDB will be assured that the task of a task queue, each time there will be a M

Tasks have time slices, that is, each time there will be a M task at the same time;

Second, InnoDB This scheduling mode will have what problem :

By the above mentioned InnoDB every time there will be a M task in execution, if this m is too large, then the CPU context switch will be frequent, so the high degree of parallelism will affect

MySQL performance.

Three, the control InnoDB parallelism and the task debugging related parameters:

1,innodb_thread_concurrency control InnoDB A parallel execution of how many tasks, that is, the most each time, how many tasks can get time slices

This value is the above mentioned in the M, if this value is 0 means that the meaning and m= infinity is the same.

2,innodb_concurrency_tickets This parameter defines the length of each task time slice.

3,innodb_thread_sleep_delay This parameter is said when InnoDB already had innodb_thread_concurrency task at the same time executed, new

Tasks to be temporary, this new task waits Innodb_thread_sleep_delay so long to be able to innodb the dispatch queue.

4,Innodb_adaptive_max_sleep_delay Indeed, most of these parameters are used to blow water, the administrator will not usually know for a given library

The above three parameters of each of the most reasonable, one side will originate from the business of cyclical fluctuations, may be the day of the task heavy, night time nobody use, no one

The value can be applied to such a wide range. And innodb_adaptive_max_sleep_delay It is used to set the limits of administrator tolerance, such as the Innodb_adaptive_max_sleep_delay

Set to 150000 means that any task must be added to the InnoDB dispatch queue after 150000 microseconds.

----

Transportation Learning & Rewards

mysql-5.7 InnoDB's parallel task scheduling detailed

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.