主从检测pt-heartbeat 的replace 语句出现在slow日志中,第15位。我觉得太慢了,但是不知道找原因,有什么建议?
slow日志( > 200ms则记录,时间6天) heartbeat1秒钟一次。
该库物理读很少(Innodb_buffer_pool_reads判断),查询基本在内存中运行。
innodb_flush_log_at_trx_commi=1,表基本都是innodb的
问题:为什么简单的一条单表更新会这么慢? 可能的问题再哪里,或者有什么分析办法?
# Query 15: 0.00 QPS, 0.00x concurrency, ID 0xD2B21E23FE8803D2 at byte 46359708
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.27
# Time range: 2015-07-21 18:18:03 to 2015-07-27 10:49:53
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 1 189
# Exec time 1 163s 201ms 3s 860ms 2s 483ms 857ms
# Lock time 0 14ms 56us 100us 75us 89us 7us 73us
# Rows sent 0 0 0 0 0 0 0 0
# Rows examine 0 0 0 0 0 0 0 0
# Query size 0 36.20k 194 197 196.12 192.76 0 192.76
# String:
# Databases test
# Hosts 192.168.0.44
# Users ysb
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms
# 10ms
# 100ms ################################################################
# 1s #######################################
# 10s+
# Tables
# SHOW TABLE STATUS FROM `test` LIKE 'heartbeat'\G
# SHOW CREATE TABLE `test`.`heartbeat`\G
REPLACE INTO `test`.`heartbeat` (ts, server_id, file, position, relay_master_log_file, exec_master_log_pos) VALUES ('2015-07-22T10:45:05.001410', '35', 'mysql-bin.000027', '998117246', NULL, NULL)\G |
|