I have several different Linux servers running MySQL 8.0.x instances (ranging from 8.0.23 to 8.0.33).
I occasionally get “error writing communication packets” from clients when connecting to the servers and running a query.
All clients run in the same LAN as the server; they are written in python (pymysql), php (PDO), c# (MysqlConnector), and this error occurs with any of them; none of them makes use of persistent connections; some of them take advantage of connection pooling/reuse depending on the capability of the respective client libraries. Nevertheless, the error keeps occurring across all of them.
I have also some cron jobs that invoke mysql client command, and even mysql client itself sometimes fails with this error.
The queries giving the error are very simple and fast, with small resultset, so there is no direct relation between the dataset size, query duration/complexity and the error.
Furthermore, the error seems to occur more frequently on test servers which sit idle most of the time, compared to production servers which have a quite high load of queries per second, although occasionally the error happens also on production servers.
I’ve googled around a lot, I’ve read tons of posts and articles about issues related to this error, and played with any possible combination of the following variables:
net_read_timeout
net_write_timeout
wait_timeout
max_allowed_packet
but with no significant change in the occurrence of the problem.
I’m pretty sure I can exclude any relation with possible network issues, as the error often occurs for client connections via “localhost” on the very same server generating the error.
The servers error logs from mysql do not include any significant or helpful message, nor I can see anything particular in syslog/messages.
I could not identify any repeating pattern for the occurrence of the error and I cannot reproduce it in any way, and I’m stuck after one year, I have absolutely no idea on how to find the root cause.
Any idea or hint on how to investigate on this?
1