mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-19312 Make throttling interval depend on thread_pool_stall_limit
A thread_pool_stall_limit which is smaller than default would result in quicker creation of threads.
This commit is contained in:
@ -28,6 +28,7 @@
|
||||
#include <time.h>
|
||||
#include <sql_plist.h>
|
||||
#include <threadpool.h>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef HAVE_IOCP
|
||||
#define OPTIONAL_IO_POLL_READ_PARAM this
|
||||
@ -865,23 +866,24 @@ end:
|
||||
|
||||
The actual values were not calculated using any scientific methods.
|
||||
They just look right, and behave well in practice.
|
||||
|
||||
TODO: Should throttling depend on thread_pool_stall_limit?
|
||||
*/
|
||||
|
||||
#define THROTTLING_FACTOR (threadpool_stall_limit/std::max(DEFAULT_THREADPOOL_STALL_LIMIT,threadpool_stall_limit))
|
||||
|
||||
static ulonglong microsecond_throttling_interval(thread_group_t *thread_group)
|
||||
{
|
||||
int count= thread_group->thread_count;
|
||||
|
||||
if (count < 4)
|
||||
if (count < 1+ (int)threadpool_oversubscribe)
|
||||
return 0;
|
||||
|
||||
|
||||
if (count < 8)
|
||||
return 50*1000;
|
||||
|
||||
return 50*1000*THROTTLING_FACTOR;
|
||||
|
||||
if(count < 16)
|
||||
return 100*1000;
|
||||
|
||||
return 200*1000;
|
||||
return 100*1000*THROTTLING_FACTOR;
|
||||
|
||||
return 200*100*THROTTLING_FACTOR;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user