Explanation of thread pool in MariaDB

Source: Internet
Author: User

Advantages of using Threadpool

The thread proxy model can be used to create a thread in advance and maintain it using the threadpool technology of the operating system when the number of connections is known to be controllable. This reduces a lot of overhead.

Use the thread management of the operating system as much as possible to minimize the thread management overhead. 3. Use thread_pool_max_threads to control the resource usage. Under what circumstances does the Thread Pool play a relatively small role:

High concurrency and long statement operations. For example, the total number of internal threadpools is 10, and 1000 requests are concurrently sent outside. Currently, all these 10 Internal Threads are competing for use, which is also a heavy overhead. Similarly, when threadpool is increased, innodb's internal concurrency will also be limited.

A large number of sudden connections. In this case, threadpool has a certain effect, but the effect is not obvious. To prevent a large number of connections. You can increase the value of thread_pool_min_threads and thread_pool_idle_timeout to maintain a large threadpool high concurrency environment, which may slow down simple queries. Although select 1; such a query should be completed very quickly. However, under the threadpool, you also need to queue up and wait for the thread available from theadpool to be executed.

Usage:

Currently, threadpool is supported by MariaDB, Percona, and a charging function of MySQL. Enable configuration.

In my. cnf

 
 
  1. [mysqld] 
  2. #thread pool 
  3. thread_handling=pool-of-threads 
  4. thread_pool_max_threads=300 
  5. thread_pool_size=64 
Link: http://www.mysqlsupport.cn/%EF%BD%8Dariadb-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.