打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
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   max_allowed_packet 状态变量的值设置太小,或者查询需要消耗的内存比已经分配给mysqld的内存更大。查看 Section B.5.2.10, “Packet Too Large”

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

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
关于Aborted connection告警日志的分析
SQL查询超时的设置方法
MySQL连接数太多应该怎么解决?
WCF之旅(6):在Winform Application中调用Duplex Service出现TimeoutException的原因和解决方案
MySQL 的默认设置下,当一个连接的空闲时间超过8小时后,MySQL 就会断开该连接
MySQL性能优化之参数配置
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服