[MDEV-5533] Backport Threadpool improvements from Percona Server Created: 2014-01-16 Updated: 2015-01-09 Due: 2015-02-06 Resolved: 2015-01-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Fix Version/s: | 10.1.3 |
| Type: | Task | Priority: | Major |
| Reporter: | Jean Weisbuch | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | percona, threadpool | ||
| Description |
|
Threadpool implementation on Percona server is based on the Maria one but some improvements has been made such as the priority queue throttling (http://www.percona.com/doc/percona-server/5.5/performance/threadpool.html#low-priority-queue-throttling) :
Another change that has been made is that the default value for the variable thread_pool_max_threads has been bumped :
The default value of 500 is pretty restrictive and can be limitating on some setups, an higher value might be better suited for default to avoid hitting the threads limit long before hitting the max_connections limit. |
| Comments |
| Comment by Colin Charles [ 2014-01-16 ] |
|
We talked about this for 10.1, but maybe we should do this in 10.0 to. Svoj, please do take a look |
| Comment by Sergei Golubchik [ 2014-08-04 ] |
|
There are different opinions about this thread_pool_max_threads increase. It's a questionable change and more analysis is needed... |
| Comment by Jean Weisbuch [ 2014-08-04 ] |
|
I personally had issues with the default value on some servers and ended up with many deadlocks on some cases where i didnt hit any problem with the default thread implementation, I think that an higher default limit with a more conservative value such as 1000 or 1500 could be enough for most setups. |
| Comment by Sergei Golubchik [ 2015-01-06 ] |
|
jb-boin, what kind of deadlocks did you have? The only possible "deadlock" that comes to my mind is when you lock all connections out, for example, with FLUSH TABLES WITH READ LOCK — so everybody has to wait — and all other 499 threads are taken by waiting connections, so you cannot connect anymore. Was that it? |
| Comment by Jean Weisbuch [ 2015-01-07 ] |
|
I dont remember if it was specifically deadlocks that were happening or query being stalled/hitting timeouts but i am certain that i hit the threads limits and queries or connections were failing while they worked just fine before switching to the threadpool and without doing other changes whatsoever. In any case i think that a default value high enough not to be blocking on most setups would be safer as the usage of threadpool is benefical on servers with many concurrent connections and is not enabled by default, which means that the threadpool probably will be mainly enabled on servers having an high concurrency and on systems that arent too limited in term of resources on which creating more than 500 threads would be hurting (which would anyway probably use less overall resources than not using the threadpool at all). |