大网数据广告活动
服务器运维问答

Why does MySQLTuner show query_cache_size (=0)?

· 52CE 我爱测

Why does MySQLTuner show query_cache_size (=0) ? In the my.cnf, I have query_cache_type = 1 query_cache_size = 16M query_cache_limit = 2M And MySQLTuner's report show this [!!] Query cache may be disabled by default due to mutex …

问题原文

原帖链接 · BlueDogRanch · CC BY-SA 3.0

Why does MySQLTuner show query_cache_size (=0)?

In the my.cnf, I have

query_cache_type = 1

query_cache_size = 16M

query_cache_limit = 2M

And MySQLTuner's report show this

[!!] Query cache may be disabled by default due to mutex contention.

[OK] Query cache efficiency: 48.5% (2M cached / 5M selects)

[!!] Query cache prunes per day: 28824

[OK] Sorts requiring temporary tables: 0% (23 temp sorts / 9K sorts)

[OK] No joins without indexes

[!!] Temporary tables created on disk: 69% (10K on disk / 15K total)

While MySQLTuner's suggestions show

query_cache_size (=0)

query_cache_type (=0)

query_cache_size (> 16M)

Is my query_cache_size not working due to the suggestion showing "(=0)" and the report showing high query cache prunes per day?

Is this becuase the "Query cache may be disabled by default due to mutex contention." ?

MySQL has been running for 48hrs.

已采纳解答

原帖链接 · Wilson Hauck · CC BY-SA 4.0

Version 8 will not have Query Cache available, they are suggesting avoiding this crutch for poorly performing or simply expensive queries.

Suggestions for your my.cnf-ini [mysqld] section

query_cache_type=0  # for OFF
query_cache_size=0  # to ensure QC is NOT USED

Not using QC reduces some amount of CPU utilization.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-09-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。