List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:August 28 2012 2:28pm
Subject:Re: qcache settings and block meaning
View as plain text  

----- Original Message -----
> From: "Raphael Bauduin" <rblists@stripped>
> And the query_cache_min_res_unit is 4096 .
> I'm not sure what the meaning of a block is. For the query cache size

What you calculated is the *average* block size, which is fairly useless :-)

The query cache is not formatted into fixed-size blocks, like a disk would be. Instead, a
block is a contiguous unit of free or used space, and the minimum that gets allocated is

Have a good look at the number of free blocks, then run FLUSH QUERY CACHE (don't worry,
that doesn't empty it, despite the name) and look again. It should be much lower.

FLUSH QUERY CACHE will defragment the query cache, and create a single contiguous free
block; which makes it easier to store large results without having to expire some older
ones. It does lock the cache for a moment, especially with large caches; so you shouldn't
run it every five minutes; but it can be well worth it to occasionally run it.

Also, don't confound that with RESET QUERY CACHE, which *will* empty it, and can thus get
your disks trashed on busy machines :-)

Linux Bier Wanderung 2012, now also available in Belgium!
August, 12 to 19, Diksmuide, Belgium -
qcache settings and block meaningRaphael Bauduin28 Aug
  • Re: qcache settings and block meaningJohan De Meersman28 Aug
  • RE: qcache settings and block meaningRick James28 Aug
    • Re: qcache settings and block meaningRaphael Bauduin29 Aug
      • RE: qcache settings and block meaningRick James29 Aug
        • Re: qcache settings and block meaningRaphael Bauduin30 Aug