mysql aborted_MySQL Aborted_clients和 Aborted_connects状态变量详解

状态变量定义

Aborted_clients

因客户端消亡时未恰当的关闭连接而引起的被中断连接数

The number of connections that were aborted because the client died without closing the connection properly.

Aborted_connects

连接MySQL服务器失败的次数。

The number of failed attempts to connect to the MySQL server。

参考链接:

https://dev.mysql.com/doc/refman/5.5/en/server-status-variables.html

状态变量数值分析

查看变量值

SHOW GLOBAL STATUS LIKE 'Aborted_connects'

SHOW GLOBAL STATUS LIKE 'Aborted_clients'

Aborted_connects

如果客户端连接mysql服务器失败,那么服务器会增加Aborted_connect变量的值,每失败一次,变量值加1。

以下几种情况会导致Aborted_connect变量值增加。

l   客户端因为没有权限访问数据库导致的连接失败

l   客户端因为密码错误导致的连接失败

l   连接包(connection packet)没有包含正确的信息导致的连接失败

l   获取连接包耗费多余connect_timeout系统变量设置的时间导致的连接失败,即连接超时(查看变量值SHOW GLOBAL VARIABLES LIKE 'connect_timeout';

Aborted_clients

如果客户端成功连接,但是没有以恰当的方式断开连接,或者是被中断,那么服务器会增加Aborted_clients状态变量的值,每次加1,并记录一条Aborted connection消息到错误日志。

以下几种情况会导致Aborted_clients状态变量值增加。

l   客户端退出之前,没有调用mysql_close()

l   客户端“沉睡”,超过wait_timeout 或者 interactive_timeout设置时间(单位:秒)没有向服务器发起任何请求。

l   客户端程序在数据传输的期间突然终止。

导致aborted connections或者aborted clients的其它原因

l   Linux使用的Ethernet协议,包含半双工和全双工。有些Linux Ethernet驱动存在这个bug。You should test for this bug by transferring a huge file using FTP between the client and server machines. If a transfer goes in burst-pause-burst-pause mode, you are experiencing a Linux duplex syndrome. Switch the duplex mode for both your network card and hub/switch to either full duplex or to half duplex and test the results to determine the best setting.

l   线程类库存在问题导致读取中断。

l   TCP/IP配置错误。

l   Ethernets, hubs, switches, cables等故障,这些只能更换硬件。

参考链接:

https://dev.mysql.com/doc/refman/5.5/en/communication-errors.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值