MySQL thread pool

Source: Internet
Author: User

MySQL connection pool and thread pool
Difference
Connection pooling is a client setting
The thread pool is the DB service-side setting

The role of connection pooling
Control clients frequently connect to DB servers, and destroy connection threads

Benefits of the thread pool
1. Preventing avalanches
2. Improve performance and improve system stability
Architecture
Mysql_thread_pool is divided into one thread (timer) and multiple groups, and each group has a corresponding worker thread
Timer thread
Control to manage the entire group, ...
Group composition
Two high and low queues
Listener
Worker
Thread Pool simplifies workflow
1. The client's request depends on the threadid%thread_pool_size to decide which group to drop
Listener in 2.group hears a new request, joins the queue or converts it to a worker thread
Thread threads in 3.group check the queue for requests,
Yes, handle, no, then hibernate, never wake up, then end thread exits after thread_pool_idle_timeout
Of course, if the number of running threads in group exceeds thread_pool_oversubscribe+1, it will also hibernate.
The 4.timer thread keeps checking to see if the group is blocked and, if so, wakes up the worker thread or rebuilds

MySQL thread pool

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.