views:

112

answers:

0

Hi, I was wondering if someone could point me in the right direction. I have set up a local Mysql 5.1 sandbox on my Snow Leopard OSX machine, I have the Macports Mysql 5.1 installed and, by all appearances, functioning. It takes queries, the database is working, etc. The only strange thing is, the query cache isn't functioning. I have gotten it functioning in linux before, and gotten it working in a 5.0 xammp install, but I am flummoxed as to why it isn't working in this set up.

Some details...

% cat /etc/my.cnf | grep -i query_cache
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1

mysql> show variables like '%query_cache%';
+------------------------------+----------+
| Variable_name                | Value    |
+------------------------------+----------+
| have_query_cache             | YES      |
| query_cache_limit            | 1048576  |
| query_cache_min_res_unit     | 4096     |
| query_cache_size             | 33554432 |
| query_cache_type             | ON       |
| query_cache_wlock_invalidate | OFF      |
+------------------------------+----------+
6 rows in set (0.00 sec)

mysql> show status like '%Qcache%';
+-------------------------+----------+
| Variable_name           | Value    |
+-------------------------+----------+
| Qcache_free_blocks      | 1        |
| Qcache_free_memory      | 33536856 |
| Qcache_hits             | 0        |
| Qcache_inserts          | 0        |
| Qcache_lowmem_prunes    | 0        |
| Qcache_not_cached       | 433      |
| Qcache_queries_in_cache | 0        |
| Qcache_total_blocks     | 1        |
+-------------------------+----------+
8 rows in set (0.01 sec)

It looks to me like everything is set up correctly, these are basically the same settings I have used on 5.0 and 4.1. The most of the queries are cache-able, and I am not excluding the cache specifically. I don't know if it a Mac issue, a MacPorts problem, or a 5.1 problem, or my personal problem. Can anyone see anything wrong with my setup?


Ok, some additional information. This seems to be related to Innodb. MyISAM queries seem to cache just fine.

My inno setup:

$ cat /etc/my.cnf | grep nno

# Uncomment the following if you are using InnoDB tables
innodb_file_per_table
innodb_data_home_dir = /opt/local/var/db/mysql5
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /opt/local/var/db/mysql5
innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 12M
innodb_log_file_size = 50M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 300
innodb_flush_method=O_DIRECT