Dear All,
I was playing with Munin and the MySQL query cache last night. My query cache was configured to me 32MiB, which is quite a chunk of memory. That made me wonder if there was no way to bring that down a little.
Munin has a great graph to help with this. It shows the number of queries of each type executed per second. Cache hits (in purple) are shown separate from select queries (in green). Simply put, the sum of the cache hits and the selects are the total sum of selects that the database handles.
I started lowering the amount of memory assigned to the query cache. All the way down from 32MiB to 2MiB nothing seemed to happen. I waited for about an hour each time, to be able to see if the ratio between selects and cache hits would change. This is pictured in the annotated screen shot below.
Note how only when I lowered the query cache size to 1MiB the ratio between selects and cache hits changed. Suddenly the number of cache hist per second dropped and the number of actual selects processed by MySQL rose. It was late, so I left it there. Next morning I logged back in and made the cache 2MiB in size.
This little exercise allowed me to reduce my query cache size by 30MiB without detrimental effect.
Kees Jan