You are on page 1of 4

Configure thread_cache_size

• The thread_cache_size directive sets the amount of threads that your


server should cache. As the client disconnects, his threads are put in
the cache if they are less than the thread_cache_size. Further
requests are completed by using the threads stored in the cache.
• To improve your performance you can set the thread_cache_size to a
relatively high number. To find the thread cache hit rate, you can use
the following technique
Set MySQL Max Connections

• The max_connections directive tells your server how many concurrent


connections are permitted. The MySQL/MariaDB server allows the
value given in max_connections + 1 for user with SUPER privileges.
The connection is opened only for the time MySQL query is executed
– after that it is closed and new connection can take its place.
• Keep in mind that too many connections can cause high RAM usage
and lock up your MySQL server. Usually small websites will require
between 100-200 connections while larger may require 500-800 or
even more. The value you apply here strongly depends on your
particular MySQL/MariaDB usage.
Enable Slow query Logs

• Logging slow queries can help you determine issues with your
database and help you debug them. 
Configure query_cache_size

• If you have many repetitive queries and your data does not change
often – use query cache. People often do not understand the concept
behind the query_cache_size and set this value to gigabytes, which
can actually cause degradation in the performance.
• The reason behind that is the fact that threads need to lock the cache
during updates. Usually value of 200-300 MB should be more than
enough. If your website is relatively small, you can try giving the value
of 64M and increase in time.

You might also like