Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL - How to diagnose cause of warning "Aborted connection - (Got timeout reading communication packets)"

I'm having some problems on our fairly busy Windows 2008 R2 web server, running MySQL.

Applications are intermittently crashing, and logs are commonly pointing to MySQL as a route cause, in that the applications cannot connect to MySQL. This is not affecting all users, just a few unlucky ones.

Having turned on warning logging in MySQL, I am seeing repeated logs of the following warning:

[Warning] Aborted connection 7153 to db user: 'XXXX' host: 'XXXXXX' (Got timeout reading communication packets)

The docs here http://dev.mysql.com/doc/refman/5.0/en/communication-errors.html suggest a range of potential network related causes.

Some of the configuation under "Advanced Networking":

Max Packet Size: 128 M (We increased this from 64 M yesterday) Wait timeout: 20 Max Connections: 1000 Max Conn per: 1000 Retry count: 5

My question is, how can I better diagnose what is causing this issue, rather than just playing with settings and waiting?

Thanks in advance

like image 435
gb2d Avatar asked Aug 08 '12 08:08

gb2d


1 Answers

This was a tricky issue to solve, but we eventually found a couple of thousand apparently orphaned TCP connections open (using Task Manager > Resource Monitor), which had been generated by an email send process.

Since MySQL connections are TCP dependent, the db server was suffering as a result.

like image 105
gb2d Avatar answered Nov 02 '22 22:11

gb2d