Hi,
I use mysql 4.1x and it has a setting to cache mysql queries.
Currently, my settings are:
+------------------------------+----------+
| Variable_name | Value |
+------------------------------+----------+
| have_query_cache | YES |
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 20971520 |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
which you can see in your mysql server by typing:
mysql> SHOW VARIABLES LIKE '%query_cache%';
So currently I have 1mb allowed per querry, for a total cache size of 20mb.
Is this ok for a typical drupal site ? Or should these be increased ?
Cordially,
Brakkar
Comments
It will depend on the specific site
you are talking about but this is a good place to start:
http://drupal.org/node/85768
Try monitoring Qcache_lowmem_prunes
Try monitoring the status variables for
Qcache_lowmem_prunes
. Ideally, it should be 0. If is isn't, try increasing the query cache size. Note though, that queries in this cache are also flushed whenever a table involved in one cached query is updated. So usage of the query cache depends on how often your tables are updated (depends on which modules you're running and user activity).Another thing you might want to consider is switching your tables from MyISAM to InnoDB, which has its own buffer pool.
Be aware of not assigning more buffers than real memory. Swaping can downgrade your site performance a lot. In fact, if you run mysql on a dedicated box, try disabling swap.
Doubt is the beginning, not the end of wisdom.