我有一个负载很重的 LAMP 系统,每秒处理大约 40 个请求,每秒执行大约 300 个 MySQL 查询。这是 MySQLAdmin 状态的输出:
Uptime: 5051 Threads: 1 Questions: 1418500 Slow queries: 0 Opens: 456
Flush tables: 1 Open tables: 450 Queries per second avg: 280.835
Run Code Online (Sandbox Code Playgroud)
但是,全局状态显示大约 5-10% 的表锁争用。
所以,我想弄清楚需要更长时间的查询。
是否可以将慢查询日志设置为小于一秒?对于我的查询,即使是 100 毫秒的执行时间也很长。