> As far as i know, this problem is caused by having sqlalchemy.pool_recycle > value larger than my.cnf [mysqld] connect_timeout I wasn't able to verify this in my environment. I set sqlalchemy.pool_recycle to 30 and connect_timeout to 60 in my.cnf and I still was getting 'MySQL server has gone away' errors. I tested this by setting my.ini and sqlalchemy variables then restarting MySQL and Pylons. After making an initial page request, I waited waited for set periods before making a second (non-cached) request. In each test, the errors started appearing right after the wait_timeout. After trying various configurations of wait_timeout, connect_timeout, and sqlalchemy.pool_recycle, the only variable that appeared to have a direct impact on my particular manifestation of this problem was wait_timeout. This makes some sense after reading the MySQL docs on this error: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
-Chris On Jan 21, 9:21 pm, Didip Kerabat <[email protected]> wrote: > As far as i know, this problem is caused by having sqlalchemy.pool_recycle > value larger than my.cnf [mysqld] connect_timeout > > - Didip - > > On Thu, Jan 21, 2010 at 8:15 AM, Ross Vandegrift <[email protected]> wrote: > > On Thu, Jan 21, 2010 at 12:05:43AM -0800, grassoalvaro wrote: > > > mysql.config > > > > wait_timeout=90 > > > max_allowed_packet=1M > > > connect_timeout=300 > > > > I fixed my pylons configurations set pool_size to 60 but didn't help. > > > Application is very simple, just 2 controllers, nothing complicated > > > (this app .I have many others with the same problem. Currently i'm > > > using cron to sending one GET request on every minute but this is > > > ugly). > > > In cases where I've run into this, I've turned the pool_recycle time > > way down - mine is set to 30, and this fixed the issue. > > > Note that this is a workaround for another problem - in my case, I > > happen to know that there is a firewall that prevents long-lived TCP > > sessions from sitting idle. This causes pooled connections to "go > > away" without notifying the application stack. > > > In theory, the better solution would be to fix that firewall's > > config. In practice, reducing the pool_recycle time doesn't affect my > > very light database load. > > > Ross > > > -- > > Ross Vandegrift > > [email protected] > > > "If the fight gets hot, the songs get hotter. If the going gets tough, > > the songs get tougher." > > --Woody Guthrie > > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.9 (GNU/Linux) > > > iEYEARECAAYFAktYfYcACgkQMlMoONfO+HAA/wCeI3s0bCFHkHB9GvQOdF3NThUO > > 5+oAoM3oPevLy4hENZF3ny4jF0MhF/3Q > > =dq1w > > -----END PGP SIGNATURE----- > > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
