Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Recently, I moved from standard MySQL to Percona, and used the Percona Wizard to generate my.cnf.

However, I can see that, by default, the generated settings for my.cnf use query_cache_type = 0. (query cache is disabled).

The only thing I run on the server is a Wordpress blog. My questions are:

  1. May I enable query cache?
  2. There are some Wordpress plugins that offer database cache. Is the result similar of enabling query cache?
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

For a Wordpress blog it should be fine to set query_cache_type = 1. See, the major problems with the query cache are:

  1. It invalidates very easily (any update on some table invalidates all queries related to said table)

  2. It has a single mutex on which any incoming or outgoing query must go through.

The query cache was fine in the days where machines had one core, maybe two; it does not fare well with multiple cores and high concurrency, and it does not fare well with write intensive applications.

Your Wordpress blog is not likely to be write intensive: your writes are new posts, updates, comments... How many of these? You may not even counter them on a per-minute basis...

It would actually not be read intensive either. Hundreds of reads per day Thousands? That's nothing.

With regard plugins, that greatly depends on the plugin and on your deployment. Wordpress is written in PHP, and PHP might use such cache mechanisms as file system, memcached or APC. It should be typically "better" caching for the specific purpose it is oriented. That is, it will invalidate cached data based on real changes to relevant data -- not for irrelevant operations on some table. The programmers of the plugin would need to decide which pieces of data are important to cache, which are not, how invalidation works.

Again, in the scale of a blog, this is no big deal, and should not make a significant difference (of course there could always be some crazy plugin).

Bottom line: for your needs, anything goes and it does not matter much.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.