Andréas

Django 1.6 introduced persistent connections:

        
https://docs.djangoproject.com/en/dev/ref/databases/#persistent-database-connections

The problem is that the mysql is dropping the connection while it is still in 
the pool on the django side (I have run into this with Java connection pools 
too, its a common gotcha). 

You might also want to check this:

        https://code.djangoproject.com/ticket/21597

I just found when I was looking at a hack I had to put in because a very long 
running script was always triggering this issue.

François

> On Dec 4, 2014, at 2:03 PM, Andreas Kuhne <andreas.ku...@suitopia.com> wrote:
> 
> François,
> 
> Thanks for your answer. I will check the settings. The problem we have had is 
> that it seems to be on ANY query, both those that take a long time and those 
> that take a short time. But I'll check. 
> 
> Being an RDS instance it's not easy for me to get the my.cnf file, but I 
> should be able to see the settings somehow.
> 
> Thanks again,
> 
> Andréas
> 
> 2014-12-04 19:58 GMT+01:00 François Schiettecatte <fschietteca...@gmail.com>:
> Andreas
> 
> Are your sql queries taking a very long time or is this for quick queries. 
> Places to start would be to check that CONN_MAX_AGE in settings.py is less 
> than wait_timeout in my.cnf. You could also check slow query log in MySQL.
> 
> I ran into this issue but with a different setup, Django 1.6, Python 2.7 and 
> MySQL-python 1.2.3, but this was specifically when I upgraded from Django 1.5 
> to 1.6 and the introduction of CONN_MAX_AGE.
> 
> François
> 
> > On Dec 4, 2014, at 1:49 PM, Andreas Kuhne <andreas.ku...@suitopia.com> 
> > wrote:
> >
> > Hi all,
> >
> > We went live with a new website, completely rewritten in python 3 and with 
> > django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course 
> > there were some minor issues, but most of them have been resolved and so 
> > far everything is working really nice.
> >
> > HOWEVER... We are having major issues with the mysql-connector-python pip 
> > package. We are running the latest stable version (2.0.2), but it seems as 
> > if the connector looses it's connection every now and then. This is really 
> > irritating as it can happen 10-15 times / day. This means that a lot of our 
> > customers are probably having problems. The exception we are getting is:
> > mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL 
> > server during query
> >
> > We are running on AWS with a RDS instance for the mysql server. This worked 
> > perfectly in our previous configuration with python 2.7 and the mysqldb 
> > connector.
> >
> > Is mysql-connector-python not ready for a production system? Is there 
> > anyone else who has had the same problems?
> >
> > Is there any other python 3 compatible connector that we can use instead? 
> > We are also using south, so it has to be compatible with south as well.
> >
> > Regards,
> >
> > Andréas
> >
> > --
> > 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 http://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-users/CALXYUbmZYaEhoyt5OCWd_F47a0LbkuQRJ3pjJL3vz98Y6hwZNA%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/9358A368-FA33-462F-AE58-DB3F86D1A7AC%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALXYUbmQGv-gDSZiRO6ycuCDCdv6XrJAuuN7GSi3W%3D2NZtcZNA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C91C47E9-34CB-4B2A-8480-55C335DD8492%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to