mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-23224 Windows threadpool - use better threadpool_max_threads default.
Use max_connections in calculation, top prevent possible deadlock, if max_connection is high.
This commit is contained in:
parent
01d994b39a
commit
5b4e69c059
1 changed files with 6 additions and 3 deletions
|
@ -355,10 +355,13 @@ int TP_pool_win::init()
|
|||
if (IS_SYSVAR_AUTOSIZE(&threadpool_max_threads))
|
||||
{
|
||||
/*
|
||||
Nr 500 comes from Microsoft documentation,
|
||||
there is no API for GetThreadpoolThreadMaxThreads()
|
||||
Default 500 comes from Microsoft documentation,
|
||||
there is no API for GetThreadpoolThreadMaxThreads().
|
||||
|
||||
To avoid deadlocks, allow at least max_connections + safety
|
||||
margin threads in the pool.
|
||||
*/
|
||||
SYSVAR_AUTOSIZE(threadpool_max_threads,500);
|
||||
SYSVAR_AUTOSIZE(threadpool_max_threads,std::max(500U,(uint)max_connections + 10));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue