mysql 告警 异常 处理_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:200  accept和waiting 一样

2.io,cpu,swap

cpu wait 20

cpu load 3.0

swap 已经占用了一半以上

3.io

利用率超过了100%

注意 iops per second  read per second  30

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[Innodb_rows_read]

update 0

state sending data 13.45 开始增长 5-20  (show processlist 也能看到)

State Sending Data

MySQL.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[Innodb_trx_lock_memory]

innodb  transaction running 变大 25

query cache not cached per second  某刻从0到800

Template MySQL DB:Query Cache not cached per second

mysql.status[Qcache_not_cached]

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[percpu,avg1]

cpu.util[,iowait]

mysql进程占用的cpu,内存等

zabbix建立一个触发器

{172.1.1.1:mysql.status[Innodb_rows_read].avg(5)}>500000 and {172.1.1.1:MySQL.State-sending-data.last()}>=5

当io超过磁盘承受能力,而sql没有索引,容易引起cpu很高。

建议创建触发器

66b6f45221e0a11cc508a2ef2bc545cb.png

8c93d621d97685212f975735dc67bd81.png

收集到的关系图

416k  106

10k    50

本文转自 liqius 51CTO博客,原文链接:http://blog.51cto.com/szgb17/1967747,如需转载请自行联系原作者

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值