Communication Errors and Aborted Connections

 很多开发看到如下日志会问dba为什么,借此机会把所有可能的原因整理出来的,希望可能给你一些排查方向。

[Note] Aborted connection 75782957 to db: 'unconnected' user: 'root' host: 'localhost' (Got timeout reading communication packets)

诊断方向

  1. error log
  2. general log
  3. show status like '%Aborted_%' 

         关注两个参数值的变化:Aborted_clients 和 Aborted_connects

详解

如果是客户端没法连接到服务端,Aborted_connects 值会增加,对应的可能性有:

  1. A client attempts to access a database but has no privileges for it. 一个没有权限的客户端对数据库发起访问。
  2. A client uses an incorrect password. 客户端使用了错误的密码。
  3. A connection packet does not contain the right information. 连接信息没有包含正确的信息。
  4. It takes more than connect_timeout seconds to obtain a connect packet. 获取连接数据包的时间超过了connect_timeout 秒。

如果这种情况发生了,可能暗示有人在入侵你的服务器.会有类似如下日志:

 [Note] Access denied for user 'drba'@'10.204.11.105' (using password: YES)

如果客户端成功连接到服务器,稍后断开了或中断了,Aborted_clients 值会增加,并伴有日志:

[Note] Aborted connection 75782957 to db: 'unconnected' user: 'root' host: 'localhost' (Got timeout reading communication packets)


对应的可能性有:

  1. The client program did not call mysql_close() before exiting.  客户端程序在退出之前没有调用 mysql_close() 方法。
  2. The client had been sleeping more than wait_timeout or interactive_timeout seconds without issuing any requests to the server. 客户端闲置时间超过了 wait_timeout  或 interactive_timeout 秒。
  3. The client program ended abruptly in the middle of a data transfer. 数据传输过程中客户端突然断开。

其他可能导致  aborted connections 或 aborted clients 的原因有:

  1. The max_allowed_packet variable value is too small or queries require more memory than you have allocated for mysqld. max_allowed_packet 参数值设置过低或查询需要的内存超过了分配值。
  2. Use of Ethernet protocol with Linux, both half and full duplex. Some Linux Ethernet drivers have this 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. 
  3. A problem with the thread library that causes interrupts on reads.
  4. Badly configured TCP/IP.
  5. Faulty Ethernets, hubs, switches, cables, and so forth. This can be diagnosed properly only by replacing hardware hardware.

转载于:https://my.oschina.net/xxj123go/blog/3074922

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值