Comments on: Beware large Query_Cache sizes https://www.percona.com/blog/beware-large-query_cache-sizes/ Thu, 28 Dec 2017 15:49:37 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Rick James https://www.percona.com/blog/beware-large-query_cache-sizes/#comment-10968829 Thu, 28 Dec 2017 15:49:37 +0000 https://www.percona.com/blog/2007/03/23/beware-large-query_cache-sizes/#comment-10968829 In reply to Peter Zaitsev.

_Each_ INSERT/UPDATE/DELETE causes _all_ entries in the QC for that table(s) to be invalidated (purged). If you have done a lot of different SELECTs, and you have a gigabyte QC, then a lot of work is needed. (Apparently AWS Aurora has rewritten the QC code, so large query_cache_size works efficiently.)

My advice is to either turn off the QC (for production systems with lots of write traffic) or keep the size below 50M.

]]>
By: Hayden James https://www.percona.com/blog/beware-large-query_cache-sizes/#comment-7764869 Fri, 11 Jul 2014 18:07:23 +0000 https://www.percona.com/blog/2007/03/23/beware-large-query_cache-sizes/#comment-7764869 Great advice! Although this article is 7 year old, its still COMPLETELY accurate if anyone wonders. On the other end setting query_cache_size too small can kill performance of cache due to prunes. Such a fine line to thread for achieving the right balance, but can be worth it.

]]>
By: James Day https://www.percona.com/blog/beware-large-query_cache-sizes/#comment-95327 Sun, 25 Mar 2007 23:59:45 +0000 https://www.percona.com/blog/2007/03/23/beware-large-query_cache-sizes/#comment-95327 http://bugs.mysql.com/bug.php?id=21074 is worth watching, since it is about improvement of the time to insert the freed query cache record into the sorted list of free blocks. Flush query cache defragments the query cache, so regular flushing is one possible way of reducing the impact.

On a related topic, http://bugs.mysql.com/bug.php?id=21051 has improved the reset query cache operation and caused it to be less likely to block other queries in 5.0.25 and 5.1.12 and later. A reset might be less painful than a flush before a rare table update, even though it’ll remove all of the cached queries.

The query cache design will undoubtedly be improved to better suit large cache sizes at some time. For the moment, it’s intended for fairly small cache sizes, in tens rather than hundreds of megabytes.

]]>
By: Peter Zaitsev https://www.percona.com/blog/beware-large-query_cache-sizes/#comment-94825 Sun, 25 Mar 2007 10:47:36 +0000 https://www.percona.com/blog/2007/03/23/beware-large-query_cache-sizes/#comment-94825 Could be. However in this case I do not see why single update would invalidate a lot of queries.
As far as I know they have millions of tables so updating each of them should invalidate only few.

The problems with extreme number of tables is another story.

]]>
By: Kevin Burton https://www.percona.com/blog/beware-large-query_cache-sizes/#comment-93438 Fri, 23 Mar 2007 22:01:07 +0000 https://www.percona.com/blog/2007/03/23/beware-large-query_cache-sizes/#comment-93438 Yeah.. I think WordPress.com had this problem for a while as well.

]]>