📜 ⬆️ ⬇️

MySQL Tuning - thread_cache_size

The thread_cache_size parameter plays an important role in the performance of a loaded MySQL server. In some cases, you can increase productivity by 30-50%.

This parameter indicates the number of threads that go to the cache when the client is disconnected. With a new connection, the thread is used from the cache, which saves resources under heavy loads.


The need to optimize the thread_cache_size parameter can be identified as follows:
mysqladmin -u root -p extended-status | grep Threads 

')
If the value of Threads_created is significantly greater than Threads_cached (by thousands), then thread_cache_size is either too small or completely disabled.

The optimal value of thread_cache_size, at which Threads_created is kept at an acceptable level, ranges from 8 to 100, depending on the load and the amount of memory.

It is recommended to gradually increase the value of thread_cache_size and watch Threads_created until Threads_created is slightly more than Threads_cached.

Source: https://habr.com/ru/post/159085/


All Articles