Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: RicochetPeter - maaliskuu 02, 2005, 10:25:58 AP

Otsikko: MySQL Query Cache
Kirjoitti: RicochetPeter - maaliskuu 02, 2005, 10:25:58 AP
Hi all,

I detected that my MySQL server's query_cache_size variable was set to 0, so it would not cache any queries. I set it to 16M, but still it wouldn't do any caching. (How do I know? MyAdmin tells me some stats:
Qcache queries in cache       0
Qcache inserts      0
Qcache hits      0
Qcache lowmem prunes      0
Qcache not cached      160
Qcache free memory      16768440 )

Any ideas on this? query_cache_type is set to 1, so it would cache anything, normally...
Otsikko: Re: MySQL Query Cache
Kirjoitti: [Unknown] - maaliskuu 02, 2005, 05:14:50 IP
There are a bunch of other settings that start with query_cache...

SHOW VARIABLES LIKE 'query\_cache%';

-[Unknown]
Otsikko: Re: MySQL Query Cache
Kirjoitti: RicochetPeter - maaliskuu 03, 2005, 07:37:57 AP
hmmmm,


mysql> SHOW VARIABLES LIKE 'query\_cache%';
+-------------------+----------+
| Variable_name     | Value    |
+-------------------+----------+
| query_cache_limit | 2048     |
| query_cache_size  | 16777216 |
| query_cache_type  | ON       |
+-------------------+----------+
3 rows in set (0.00 sec)

mysql> show status like 'Qc%';
+-------------------------+----------+
| Variable_name           | Value    |
+-------------------------+----------+
| Qcache_queries_in_cache | 0        |
| Qcache_inserts          | 0        |
| Qcache_hits             | 0        |
| Qcache_lowmem_prunes    | 0        |
| Qcache_not_cached       | 17547    |
| Qcache_free_memory      | 16768440 |
| Qcache_free_blocks      | 1        |
| Qcache_total_blocks     | 1        |
+-------------------------+----------+
8 rows in set (0.00 sec)


It's a MySQL 4.0.23 on W2K3 Server. Not that it's slow or so, but I'd be interested to tweak it anyway.
Otsikko: Re: MySQL Query Cache
Kirjoitti: Ben_S - maaliskuu 03, 2005, 11:28:28 AP
Looks like you have your limit set extreamly low, anything over the limit wont be cached, so I imagine everything is bigger than that limit hence it isn't being cached,
Otsikko: Re: MySQL Query Cache
Kirjoitti: RicochetPeter - maaliskuu 03, 2005, 11:40:00 AP
Oh dear, my fault, you are so right. Maybe I thought those were kilobytes...