Thread Pool System and Status Variables
You are viewing an old version of this article. View
the current version here.
Contents
This article describes the system and status variables used by the MariaDB thread pool. For a full description, see Thread Pool in MariaDB.
System variables
extra_max_connections
- Description: The number of connections on the extra_port. Introduced for the MariaDB 5.1 threadpool.
- Commandline:
--extra-max-connections=#
- Scope: Global
- Dynamic: Yes
- Data Type:
numeric
- Default Value:
1
- Range:
1
to100000
- Introduced: MariaDB 5.1
extra_port
- Description: Extra port number to use for tcp-connections in a one-thread-per-connection manner. If set to
0
, no other port is used. Introduced for the MariaDB 5.1 threadpool. - Commandline:
--extra-port=#
- Scope: Global
- Dynamic: No
- Data Type:
numeric
- Default Value:
0
- Introduced: MariaDB 5.1
thread_handling
- Description: Determines how the server handles threads. The default,
one-thread-per-connection
, sees the server use one thread to handle each client connection,pool-of-threads
uses thread_pool_size threads to execute all queries (see Thread Pool in MariaDB, whileno-threads
sees the server use a single thread for all connections (only usable for debugging). - Commandline:
--thread-handling=name
- Scope: Global
- Dynamic: No
- Data Type:
enumeration
- Default Value:
one-thread-per-connection
- Valid Values:
no-threads
,one-thread-per-connection
,pool-of-threads
. - Documentation: Using the thread pool.
- Notes: In MySQL the thread pool is only available in MySQL enterprise 5.5.16 and above. In MariaDB it's available in all versions.
thread_pool_idle_timeout
- Description: Time in seconds until an idle worker thread exits. Unix-only. Use thread_pool_min_threads in Windows.
- Commandline:
thread-pool-idle-timeout=#
- Scope: Global
- Dynamic: Yes
- Data Type:
numeric
- Default Value:
60
- Introduced: MariaDB 5.5.21
- Documentation: Using the thread pool.
tthread_pool_prio_kickup_timer
- Description: The number of milliseconds before a dequeued low-priority statement is moved to the high-priority queue. Unix-only
- Commandline:
thread-pool-kickup-timer=#
- Scope: Global
- Dynamic: Yes
- Data Type:
numeric
- Default Value:
1000
- Range:
0
to4294967295
- Introduced: MariaDB 10.2.2
- Documentation: Using the thread pool.
thread_pool_max_threads
- Description: Maximum number of threads in the thread pool. Once this limit is reached, no new threads will be created.
- Commandline:
thread-pool-max-threads=#
- Scope: Global
- Dynamic: Yes
- Data Type:
numeric
- Default Value:
1000
(>= MariaDB 10.1)500
(<= MariaDB 10.0) - Range:
1
to65536
- Introduced: MariaDB 5.5.21
- Documentation: Using the thread pool.
thread_pool_min_threads
- Description: Minimum number of threads in the thread pool. In bursty environments, after a period of inactivity, threads would normally be retired. When the next burst arrives, it would take time to reach the optimal level. Setting this value higher than the default would prevent thread retirement even if inactive. Windows-only. Use thread_pool_idle_timeout in Unix.
- Commandline:
thread-pool-min-threads=#
- Data Type:
numeric
- Default Value:
1
- Introduced: MariaDB 5.5.21
- Documentation: Using the thread pool.
thread_pool_oversubscribe
- Description: Internal parameter, not meant to be changed. The higher the value for this parameter, the more threads that could run at the same time. A lower value can lead to more sleeps and wakeups.
- Scope: Global
- Dynamic: Yes
- Data Type:
numeric
- Default Value:
3
- Range:
1
to65536
- Introduced: MariaDB 5.5.21
- Documentation: Using the thread pool.
thread_pool_priority
- Description: Threadpool priority. High priority connections usually start executing earlier than low priority. If priority set to 'auto', the the actual priority(low or high) is determined based on whether or not connection is inside transaction.
- Commandline:
--thread-pool-priority=#
- Scope: Global,Connection
- Data Type:
enumeration
- Default Value:
auto
- Valid Values:
high
,low
,auto
. - Introduced: MariaDB 10.2.2
- Documentation: Using the thread pool.
thread_pool_size
- Description: Number of threads in a thread pool, which determines how many statements can execute simultaneously. Unix only. See Threadpool in MariaDB.
- Commandline:
--thread-pool-size=#
- Scope: Global
- Dynamic: Yes
- Data Type:
numeric
- Default Value: Based on the number of processors (but see MDEV-7806).
- Range:
1
to128
- Introduced: MariaDB 5.5.21
- Documentation: Using the thread pool.
thread_pool_stall_limit
- Description: Time in milliseconds statement has to complete after starting before being defined as stalled. After this, the thread group can begin another statement. Higher values can help avoid starting too many new statements while old, long-running ones are still executing, while lower values can help prevent deadlock. See Threadpool in MariaDB. Note that if porting from the commercial MySQL plugin, the unit used in their implementation is 10ms, not 1ms.
- Commandline:
--thread-pool-stall-limit=#
- Scope: Global
- Dynamic: Yes
- Data Type:
numeric
- Default Value:
500
- Range:
4
to600
- Introduced: MariaDB 5.5.21
- Documentation: Using the thread pool.
Status variables
Threadpool_idle_threads
- Description: Number of inactive threads in the thread pool. Only meaningful on Unixes, not tracked on Windows. Threads become idle either by waiting for new work, or if it's blocked due to disk io, row or table lock etc.
- Scope: Global, Session
- Data Type:
numeric
- Introduced: MariaDB 5.5
Threadpool_threads
- Description: Number of threads in the thread pool.
- Scope: Global, Session
- Data Type:
numeric
- Introduced: MariaDB 5.5
See also
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.