Jocke
Jocke

Reputation: 1

Loosing connections and temporary slowness in Cloud SQL

We have a Django Application (hosted on Compute Engine), that uses Cloud SQL (D2 instance). We've set up really frequent monitoring of it in the Load Balancers health checks. We do however about once per day get a bunch of the following errors: django.db.utils:OperationalError: (2013, 'Lost connection to MySQL server at \'reading initial communication packet\', system error: 0 "Internal error/check (Not system error)"').

Typically the MySQL/Cloud SQL interaction of the health checks takes less than 20ms, however a few times a day the it can suddenly take 500-1200 ms.

The database is really lightly loaded (health checks count for > 95% of the requests to the system) and we've not seen any similar issues during heavy load testing. There just seems to be something randomly causing Cloud SQL to perform really slowly for a request or two or drop the connections and then continue to work normally.

What could be the reason to both loosing the connection and to the random, but extreme slowness? Any ideas on how to possibly fix both issues?

Upvotes: 0

Views: 260

Answers (1)

Leo Meirelles
Leo Meirelles

Reputation: 42

This behavior can be caused by having backup enabled.

Can you check if you have this option? It is located under Edit instance > Backup section.

Note that the timezone is the same of your browser - if you live in NYC the backup time window will be in UTC-5.

Upvotes: 0

Related Questions