Symptoms
In some MySQL configurations, you may find that connections to databases continuously timeout and correspond to the following entries in the MySQL error log:
[Warning] Aborted connection to db: 'username_site' user: 'username_site' host: 'localhost' (Got timeout reading communication packets)
Description
Timeouts reading communication packets are often caused by low timeout values set in /etc/my.cnf.
wait_timeout=30
net_read_timeout=30
net_write_timeout=60
The wait_timeout setting controls the number of seconds the server waits for activity on a non-interactive connection before closing it. Changing this value first will often resolve most issues.
The net_read_timeout and net_write_timeout values may also contribute to timeouts if their values are set lower than wait_timeout. Setting these higher than wait_timeout may resolve any remaining issues.
Workaround
Refer to the following MySQL documentation to ensure these values are set to meet your server's needs: