Mysql settings for query_cache_min_res_unit
May 24, 2013 in answer
ANSWER:
Observations
- Your question says you have 426870 for
Qcache_total_blocks. Since each block is 1K, blocks are aligned to the nearest multiple of 1024. Thus, your query cache has about 417M. - If you divide
Qcache_not_cached(7128902) byQcache_inserts(49557287), this shows that about 14.4% (1 out of 7) of your queries could not be cached. - (
Qcache_total_blocks(426870) –Qcache_free_blocks(35327)) /Qcache_queries_in_cache(195659) = 2K - On average, each query cache result hold about 2K, which is theoretically not possible. This could indicate some fragmentation in the query cache.
Recommendations
- You need a bigger value for query_cache_size (perhaps 2G). If you are using InnoDB, you may get some performance increase if you disable the query cache altogether by setting query_cache_size to 0.
- You need a smaller value for query_cache_min_res_unit (minimum value is 512 (0.5K)) if you want to hold small result sets.
- You need a bigger value for query_cache_limit if you want to cap how big a result is too big.
- See my earlier post : Is the overhead of frequent query cache invalidation ever worth it?
RolandoMySQLDBA from http://dba.stackexchange.com/questions/43003

New Comments