Bennett Garner
1 min readMay 29, 2019

--

This may not be a problem. “This message is triggered when an existing connection is terminated improperly, which may look erroneous but is actually perfectly normal. Aborted connections happen because of unclean closure of connection(like when instances scale down and get terminated) or networking problem between the server and the client, but not because of the server.”

One thing I’d look at is whether your Django application is closing connections after using them. If a connection sits idle for a long time it’ll get killed by MySQL once the wait_timeout limit is reached. To get Django to close idle connections (instead of MySQL aborting them), set a CONN_MAX_AGE in your settings.py. Here’s the docs: https://docs.djangoproject.com/en/2.2/ref/databases/

Here’s a good resource on the error if you’re still having trouble debugging — https://www.percona.com/blog/2016/05/16/mysql-got-an-error-reading-communication-packet-errors/

--

--

Bennett Garner
Bennett Garner

Written by Bennett Garner

DeveloperPurpose.com — Build a coding career with meaning and purpose 💻 Top writer in technology ✍️

Responses (1)