How to calculate 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 are 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';

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.

Post navigation

Leave a Reply