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.

MySQL Documentation 
: https://dev.mysql.com/doc/refman/5.7/en/error-lost-connection.html , says 
: "Usually it indicates network connectivity trouble and you should check 
the condition of your network" - but we only get this issue with our 2 
biggest clients. I feel if this was the case it would, at least, be a bit 
random.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4377f978-20b7-40c7-a14d-6e7d6d9617a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to