xyzjr 发表于 2018-10-7 12:42:36

mysql故障 异常数据 最近一次

  发一个报警和故障数据对比图
  性能对比
  sda.util
  报警139%
  故障100%-149%
  bytes read per second on sda
  报警500K
  故障15-20M
  sda:read:iops per second
  报警66
  read requests issued per second to sda
  报警50
  故障400
  mysql异常的特征和监控的关键数据
  1.nginx 连接数
  waiting:200accept和waiting 一样
  2.io,cpu,swap
  cpu wait 20
  cpu load 3.0
  swap 已经占用了一半以上
  3.io
  利用率超过了100%
  注意 iops per secondread per second30
  Bytes read per second on sda 20M/s
  3.mysql 性能参数
  读写次数
  insert 20
  read 300k 增加到800k
Template MySQL InnoDB: InnoDB Rows Read per second  mysql.status
  update 0
  state sending data 13.45 开始增长 5-20(show processlist 也能看到)
State Sending DataMySQL.State-sending-data  threads running也变得很大
  Thread_running突然飙高的诱因:
  1 客户端连接暴增;
  2 系统性能瓶颈,如CPU,IO或者mem swap;
  3 异常sql;
  往往在这种情况下,MySQL server会表现出hang住的假象
  反而threads cached 复用资源很高 最多到20-25
  mysql连接数 120-200
  handler_read_key per second 变大了
  innodb log pending fsyncs 有2.0的波动
  innodb transaction lock memory 增加到10k-25k
  Template MySQL InnoDB: InnoDB Transaction Lock Memory
  mysql.innodb
  innodbtransaction running 变大 25
  query cache not cached per second某刻从0到800
  Template MySQL DB: Query Cache not cached per second
  mysql.status
  4.tomcat 连接数
  5.nginx 每个连接时间
  6.平常swap经常告警,说明有慢查询语句,应该是没用索引。swap缺少这个就需要开始收集慢查询语句了。
  报警
  Response time is too high on 172.1.1.1
  system.swap.size[,pfree]50%,swap居高不下,就要关注了,容易崩溃了
  172.1.1.1 Disk I/O is overloaded on 172.1.1.1
  cpu.load
  cpu.util[,iowait]
  mysql进程占用的cpu,内存等
  zabbix建立一个触发器
{172.1.1.1:mysql.status.avg(5)}>500000 and {172.1.1.1:MySQL.State-sending-data.last()}>=5  当io超过磁盘承受能力,而sql没有索引,容易引起cpu很高。
  建议创建触发器


  收集到的关系图
  416k106
  10k    50

页: [1]
查看完整版本: mysql故障 异常数据 最近一次