Since few weeks I was working on patching the MySQL 5.1 with libevent support to have thread pooling in server end as it is needed by few properties where they do not need a persistent connection and needed to scale server with thousands of connections as each call just does a simple query execution by connecting and disconnecting and pooling seemed to be a right choice.
When I brought this idea to Monty; he pointed me to 6.0 where it is in preliminary stage. Now I took the same design and implemented in 5.1 to be compatible with how its working in 6.0; and things so far seems to be running fine, except few misc glitches that am trying to solve now.
It uses the same thread_handling=one-thread-per-connection (default) and new thread_handling=pool_of_threads and thread_pool_size controls how many will be initialized and kept at the startup.
1 2 3 4 |
| thread_handling | pool-of-threads | | thread_pool_size | 5010 | |
Few things that are missing from the 6.0 is the status of thread pools (number of threads currently in use, max used so far from pool etc) are all added now.
I am currently benchmarking the performance between the regular persistent to pool-of-threads model to see how it works out. I will post more details once I have the graphs and numbers along with working model.
Cool. We are backporting this to 5.0 and have a server running with 8000 connections. This is a great feature and something that I really want in a release that I can use in production this year. One extra feature that I want is the ability to limit an account to a max number of concurrent active connections.
Mark
Do you mean to say limit user X from using maximum of N threads at a time ? that will be ideal.. but wondering whats the syntax..
–max_user_concurrency=N,username ?
DO WANT guys….. I’m dying for this feature.
Now all I have to do is migrate to MySQL 5.1 🙂
Venu,
Probably what Mark is talking about is already implemented as the MAX_USER_CONNECTIONS GRANT option.
The MAX_USER_CONNECTIONS count option, implemented in MySQL 5.0.3, limits the maximum number of simultaneous connections that the account can make. If count is 0 (the default), the max_user_connections system variable determines the number of simultaneous connections for the account.
GRANT USAGE ON *.* … WITH MAX_USER_CONNECTIONS N;
You just need to make sure your extension enforces this limit too.
Thanks Matthew..Good to know that we already have that; time to read the manual; atleast on new offerings.
MySQL 5.1 – Thread Pool Support https://t.co/hiWVjPwp
: https://t.co/hiWVjPwp