This article describes the system and status variables used by the MariaDB thread pool. For a full description, see Thread Pool in MariaDB.
extra_max_connections
extra_port
. --extra-max-connections=#
numeric
1
1
to 100000
extra_port
one-thread-per-connection
manner. If set to 0
, then no extra port is used. --extra-port=#
numeric
0
thread_handling
one-thread-per-connection
mode is enabled, the server uses one thread to handle each client connection. pool-of-threads
mode is enabled, the server uses the thread pool for client connections. no-threads
mode is enabled, the server uses a single thread for all client connections, which is really only usable for debugging. --thread-handling=name
enumeration
one-thread-per-connection
no-threads
, one-thread-per-connection
, pool-of-threads
. thread_pool_dedicated_listener
thread-pool-dedicated-listener={0|1}
boolean
0
thread_pool_exact_stats
thread-pool-exact-stats={0|1}
boolean
0
thread_pool_idle_timeout
60
. If there is currently no work to do, how long should an idle thread wait before exiting? thread_pool_min_threads
system variable is comparable for Windows. thread-pool-idle-timeout=#
numeric
60
thread_pool_max_threads
thread-pool-max-threads=#
numeric
65536
(>= MariaDB 10.2.4) 1000
(<= MariaDB 10.2.3, >= MariaDB 10.1) 500
(<= MariaDB 10.0) 1
to 65536
thread_pool_min_threads
thread_pool_idle_timeout
system variable is comparable for Unix. thread-pool-min-threads=#
numeric
1
thread_pool_oversubscribe
3
. Usually, a thread group only has one active worker thread at a time. However, the timer thread can add more active worker threads to a thread group if it detects a stall. There are trade-offs to consider when deciding whether to allow only one thread per CPU to run at a time, or whether to allow more than one thread per CPU to run at a time. Allowing only one thread per CPU means that the thread can have unrestricted access to the CPU while its running, but it also means that there is additional overhead from putting threads to sleep or waking them up more frequently. Allowing more than one thread per CPU means that the threads have to share the CPU, but it also means that there is less overhead from putting threads to sleep or waking them up. numeric
3
1
to 65536
thread_pool_prio_kickup_timer
thread-pool-kickup-timer=#
numeric
1000
0
to 4294967295
thread_pool_priority
--thread-pool-priority=#
enum
auto
high
, low
, auto
. thread_pool_size
--thread-pool-size=#
numeric
1
to 128
(< MariaDB 5.5.37, MariaDB 10.0.11), 1
to 100000
(>= MariaDB 5.5.37, MariaDB 10.0.11) thread_pool_stall_limit
500
. Stall detection is used to prevent a single client connection from monopolizing a thread group. When the timer thread detects that a thread group is stalled, it wakes up a sleeping worker thread in the thread group, if one is available. If there isn't one, then it creates a new worker thread in the thread group. This temporarily allows several client connections in the thread group to run in parallel. However, note that the timer thread will not create a new worker thread if the number of threads in the thread pool is already greater than or equal to the maximum defined by the thread_pool_max_threads
variable, unless the thread group does not already have a listener thread. --thread-pool-stall-limit=#
numeric
500
10
to 4294967295
(< MariaDB 10.5), 1
to 4294967295
(>= MariaDB 10.5) Threadpool_idle_threads
numeric
Threadpool_threads
thread_pool_max_threads
, because each thread group needs at least two threads (i.e. at least one worker thread and at least one listener thread) to prevent deadlocks. numeric
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/thread-pool-system-and-status-variables/