|
Thread_cahe_size thread pool thread cache. Used to cache the idle thread, so as not to be destroyed, if the thread cache idle threads, you need to re-establish a new connection, it will invoke a cache priority thread pool, it will soon be able to respond to connection requests.
Each establish a connection, you need to match a thread
MariaDB [(none)]> show global status like '% thread%';
------------------------------------------ + ------ + ---- +
| Variable_name | Value |
------------------------------------------ + ------ + ---- +
| Delayed_insert_threads | 0 |
| Innodb_master_thread_1_second_loops | 4338823 |
| Innodb_master_thread_10_second_loops | 432031 |
| Innodb_master_thread_background_loops | 18974 |
| Innodb_master_thread_main_flush_loops | 18974 |
| Innodb_master_thread_sleeps | 4338819 |
| Performance_schema_thread_classes_lost | 0 |
| Performance_schema_thread_instances_lost | 0 |
| Slow_launch_threads | 0 |
| Threadpool_idle_threads | 0 |
| Threadpool_threads | 0 |
| Threads_cached | 0 | represents the current moment of idle threads in the thread cache
| Threads_connected | 11 | connections currently established on behalf of a number
The number of threads since the last service startup, created | | Threads_created | 11032160
| Threads_running | 2 | The number of threads currently active (non-sleep) of
------------------------------------------ + ------ + ---- +
thread_cache_size best arranged and threads_connected same. But few will thread_cache_size than 200 set large.
Configuration:
mysql> set global thread_cache_size = 30 with immediate effect
or
vim /etc/my.cnf
thread_concurrency = 30
Restart mysql. |
|
|
|