Hi,
We are using amazon AWS to run our commands that then talk to a db on amazon RDS.
Our nightly commands sometimes fail with 'Lost connection to MySQL server during query' - this only happens on our big databases.
If the commands are successful they usually report 28,29 mins. So we feel when they hit 30mins they fail and then there is a knock on affect - the commands that run after the failed one all get MySQL Server Gone Away errors.
We process multiple databases at the same time, and when this happens it's only that one connection that fails - there's no knock on to the others.
We have checked our timeout variables, and they are all high numbers, 5000 etc...
We've had this issue on and off for a while and have never gotten to the bottom of it.
How we run our commands:
from django.db import connections
connection = connections[get_connection(account)]
cursor = connection.cursor()
cursor.execute('some sql')
cursor.close()
Each command is a file on its own with this code - so we create a connection per command.
Our commands then run one after the other.
I'm curious if django.db connections has its own timeout set? I'm really at a loss on what/how to investigate this further.
Any help would be greatly appreciated