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.

I have a VPS running CentOS 6.4 and 2.5GB RAM, Intel(R) Xeon(R) CPU. Its MySQL version is Server version: 5.5.35-cell. I have two active wordpress sites and two inactive sites (inactive sites use for some test and one for personal use) in this server.

This VPS MySQL configuration file has following query cache.

thread_cache_size = 16

query_cache_type = 1
query_cache_size = 30M
query_cache_limit = 1M

After 30 minutes left, my table cache hit rate goes to the lower level. After 1h 49m 0s MySQL up-time, it's 4% (334 open / 7K opened).

I think to overcome this issue, I have to reset query cache, rather than the flush query cache. Therefore, how do I automatically Reset Query Cache for optimize MySQL table caching?

share|improve this question
add comment

1 Answer 1

The query cache is only helpful for low write, high read workloads and should be pretty handy on a blog with this access pattern. If you issue any DML then you invalidate the QC for that table and repopulation would be necessary. Have you calculated the QC efficiency based on your local status?

http://www.mysqlperformanceblog.com/2006/07/27/mysql-query-cache/

The table cache is a different animal. It caches tables in memory so that MySQL can avoid the overhead of opening them. There's a recipe for tuning this, which is something along the lines of depth of longest join * max_connections but I doubt this us causing you trouble. It's likely that you would be better off tuning the key_buffer (MyISAM's cache for indexes) or the Innodb_buffer_pool_size (InnoDB cache for data + indexes) to reduce load on the server.

http://www.mysqlperformanceblog.com/2009/11/16/table_cache-negative-scalability/

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.