Admin-Ahead Community

Linux => General Linux => Topic started by: arunlalpr on November 08, 2018, 09:17:21 am

Title: Configure MySQL thread_cache_size
Post by: arunlalpr on November 08, 2018, 09:17:21 am

Configure MySQL thread_cache_size

This parameter sets the amount of thread for cache purposes. If client disconnects, his thread are kept in the cache. If the requests are less than the  thread_cache_size then threads that stored in cache will serve the requests.


To find the thread cache hit rate,

Kindly access Mysql and enter the following commands.

mysql> show status like 'Threads_created';
mysql> show status like 'Connections';


(https://admin-ahead.com/forum/gallery/660_08_11_18_9_14_23.png)

Now use the following formula to calculate the thread cache hit rate percentage:

100 - ((Threads_created / Connections) * 100)


In this case it is --->>> 100 - ((26/4304) * 100 ) = 99.39


The most useful thing  is that the thread_cache_size can be dynamically changed without having to restart the MySQL service.