ramblings on PHP, SQL, the web, politics, ultimate frisbee and what else is on in my life
back

MySQL Query Cache invalidation changes

I just wanted to point everybody at a recent blog post by Konstantin. In the post he discusses a solution for dealing with cache invalidation issues of very large caches under heavy load. He points out that cache invalidation can severely bog down the system. The general solution he proposes is to simply deactivate the query cache entirely during invalidation. I think this is an important caveat to be aware of and actually he is asking for feedback if this "solution" is acceptable. I think its awesome that MySQL engineers are giving us the opportunity to provide feedback on such changes. Maybe there should be a dedicated "pipeline" where such requests could be found?

Comments



Re: MySQL Query Cache invalidation changes

Their internal worklogs are available on the MySQL Forge.

Re: MySQL Query Cache invalidation changes

Yeah I know .. but I think it should be pushed more towards the open, especially items where they are planning on breaking BC or where they are unsure of how to proceed. The above linked blog post for example is hosted in a blog that does not allow people without a live journal account to post. Not the right place to ask for feedback if you ask me.

Re: MySQL Query Cache invalidation changes

Lukas, could you possibly explain to the slow, average people with just a plain ol' business degree here in the audience what this means for your average high-load webapp? I'm about to launch one of the above, and things like "completely stops the server" make me nervous. I don't even know where to *find* the query cache in MySQL...

This is why we have smart people like you, and this is why we read your blogs...!

Re: MySQL Query Cache invalidation changes

You can find information about the query cache in the mysql manual. From what I have seen this is a fairly rare occurance. It should only happen if you have a really large table on which you run a lot of very different queries that join many tables so that invalidation of the cache takes a lot of time.

Check if your cache is enabled via:
{
mysql> SHOW VARIABLES LIKE 'have_query_cache';
}

Generally the query cache can improve your performance a lot, but if you frequently invalidate your caches due to updates, then this advantage will be diminished. For the most part though, the query cache will allow your server to deal with much higher loads.

Re: MySQL Query Cache invalidation changes

Hey Lukas, I will enable back anonymous posts.
I had tons of spam and ads when I had them enabled, but whatever.