MySQL 45 [Note] Aborted connection 45 to db: ‘postfix’ user: ‘postfix’ host: ‘localhost’ (Got an error reading communication packets)
Замечание возникло после обновления версии 5.6 на 5.7.
Согласно документации это может быть вызвано следующими причинами:
If a client successfully connects but later disconnects improperly or is terminated, the server increments the Aborted_clients
status variable, and logs an Aborted connection message to the error log. The cause can be any of the following:
- The client program did not call
mysql_close()
before exiting. - The client had been sleeping more than
wait_timeout
orinteractive_timeout
seconds without issuing any requests to the server. See Section 5.1.7, “Server System Variables”. - The client program ended abruptly in the middle of a data transfer.
Other reasons for problems with aborted connections or aborted clients:
- The
max_allowed_packet
variable value is too small or queries require more memory than you have allocated for mysqld. See Section B.3.2.8, “Packet Too Large”. - 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.
- A problem with the thread library that causes interrupts on reads.
- Badly configured TCP/IP.
- Faulty Ethernets, hubs, switches, cables, and so forth. This can be diagnosed properly only by replacing hardware.
Так как сеть и ее настройки не менялись, а только обновились Dovecot, Postfix и MySQL то виновником была какая то из этих программ.
В итоге, изменил и добавил такие переменные:
# ee /usr/local/etc/mysql/my.cnf
[mysqld]
....
max_allowed_packet = 256M # было 16М
max_connections = 400
wait_timeout = 28800
connect_timeout = 10
interactive_timeout = 28800
....
перестартуем сервис:
# service mysql-server restart # service mysql-server status
Полностью проблему не убрало, но стало вместо 1 раза в 2-3 минуты, до 1 раза в 25-35 минут.
https://dovecot.org/pipermail/dovecot/2019-October/117403.html
https://deniapps.com/blog/mysql-rds-aborted-connection-error-aws-lambda