MySQL性能问题排查及优化

1.QPS(每秒查询数)

show global status like 'com_select';
show global status like 'com_update';
show global status like 'com_delete';
show global status like 'uptime';
QPS(MySQL Server 每秒执行的Query总量)=(com_update+com_insert+com_delete+com_select)/uptime

2.TPS(每秒事务数)

show global status like 'com_rollback';
show global status like 'com_commit';
show global status like 'uptime';
TPS(每秒事务量)=(com_commit+com_rollback)/uptime

3.连接数监控

1)服务器设置的最大连接数
show global status like 'max_connections';
2)查看服务器在处理时的最大连接数
show global status like 'Max_used_connections';
3)数据库运行的总连接数
show global status like 'Connections';
4)当前连接数
show global status like 'Threads_connected';
5)获得当前正在运行的连接数
show global status like 'Threads_running';
建议合理比例Max_used_connections / max_connections =0.8

4.数据库读写比列

1.获得服务器启动到目前查询操作执行的次数;
show global status like 'Com_select';
2.获得服务器启动到目前插入操作执行的次数;
show global status like 'Com_insert';
3.获得服务器启动到目前更新操作执行的次数;
show global status like

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值