MySQL query cache
The MySQL query cache is disabled by defaultOnce you have enabled it in /etc/my.cnf
query_cache_size=8M
and restarted mysqld you can check its settings using
mysql> SHOW STATUS LIKE 'qcache%';
+-------------------------+----------+
| Variable_name | Value |
+-------------------------+----------+
| Qcache_free_blocks | 505 |
| Qcache_free_memory | 1379664 |
| Qcache_hits | 14512295 |
| Qcache_inserts | 2372908 |
| Qcache_lowmem_prunes | 367026 |
| Qcache_not_cached | 4759779 |
| Qcache_queries_in_cache | 4784 |
| Qcache_total_blocks | 10301 |
+-------------------------+----------+
8 rows IN SET (0.02 sec)
+-------------------------+----------+
| Variable_name | Value |
+-------------------------+----------+
| Qcache_free_blocks | 505 |
| Qcache_free_memory | 1379664 |
| Qcache_hits | 14512295 |
| Qcache_inserts | 2372908 |
| Qcache_lowmem_prunes | 367026 |
| Qcache_not_cached | 4759779 |
| Qcache_queries_in_cache | 4784 |
| Qcache_total_blocks | 10301 |
+-------------------------+----------+
8 rows IN SET (0.02 sec)
and
mysql> SHOW VARIABLES LIKE 'query_cache%';
+------------------------------+----------+
| Variable_name | Value |
+------------------------------+----------+
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 16777216 |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
+------------------------------+----------+
5 rows IN SET (0.00 sec)
+------------------------------+----------+
| Variable_name | Value |
+------------------------------+----------+
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 16777216 |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
+------------------------------+----------+
5 rows IN SET (0.00 sec)
MySqlQueryCacheGrowing
REFERRERS
MySqlConfiguration