[sqlalchemy] Re: DB Operational Error
Hi Michael, On Nov 2, 1:07 am, Michael Bayer [EMAIL PROTECTED] wrote: look into the pool_recycle option described athttp://www.sqlalchemy.org/docs/05/dbengine.html I'm also getting these errors, and I have pool_recycle, pool_size and max_cycle set. I'm using Pylons, SQLAlchemy 0.5 and MySQLdb 1.2.2 # lines from my Pylons ini file sqlalchemy.default.pool_recycle = 3600 sqlalchemy.default.pool_size = 32 sqlalchemy.default.max_overflow = 1024 I think that the reason this happens is because this is not a stateful app, but rather a state-less web site. Every request to the site is a full but isolated execution of the app, and this makes me think that SQLAlchemy doesn't really have a Pool to work with. I'm rather flummoxed on this one. No one seems to have an answer other than pool_recycle - which is not working. Kind regards, Raoul Snyman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: DB Operational Error
On Nov 4, 3:36 am, Raoul Snyman [EMAIL PROTECTED] wrote: Hi Michael, On Nov 2, 1:07 am, Michael Bayer [EMAIL PROTECTED] wrote: look into the pool_recycle option described athttp://www.sqlalchemy.org/docs/05/dbengine.html I'm also getting these errors, and I have pool_recycle, pool_size and max_cycle set. I'm using Pylons, SQLAlchemy 0.5 and MySQLdb 1.2.2 # lines from my Pylons ini file sqlalchemy.default.pool_recycle = 3600 sqlalchemy.default.pool_size = 32 sqlalchemy.default.max_overflow = 1024 You have a recycle time of 1 hour (3600 seconds). That is usually short enough. I've encountered situations where a firewall closed idle connections after 30 minutes, leading to server has gone away errors. Could the MySQL configuration be set to an idle timeout that is less than an hour? Could you somehow be opening connections from outside the pool? (I did that to myself when trying to add some conversion functions to the MySQLdb module.) I think that the reason this happens is because this is not a stateful app, but rather a state-less web site. Every request to the site is a full but isolated execution of the app, and this makes me think that SQLAlchemy doesn't really have a Pool to work with. Then you'd be starting fresh every time and there would be no opportunity for a stale connection. I'm rather flummoxed on this one. No one seems to have an answer other than pool_recycle - which is not working. You could try cutting the recyle value down to 60 seconds. You need a recycle time that is less than the idle timeout. If 60 seconds fixes the problem, then you know that you have a short idle timeout setting elsewhere. Kind regards, Raoul Snyman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: DB Operational Error
the MySQL has gone away error usually corresponds to a connection thats been held open without activity for 8 hours. if thats not the case here, either the MySQL client config has the timeout turned way down or something is broken at the network level. im not sure if by isolated execution you mean that youre running Pylons as a CGI or doing some other kind of teardown after requests, so some clarification on that may be helpful here. On Nov 4, 2008, at 3:36 AM, Raoul Snyman wrote: Hi Michael, On Nov 2, 1:07 am, Michael Bayer [EMAIL PROTECTED] wrote: look into the pool_recycle option described athttp://www.sqlalchemy.org/docs/05/dbengine.html I'm also getting these errors, and I have pool_recycle, pool_size and max_cycle set. I'm using Pylons, SQLAlchemy 0.5 and MySQLdb 1.2.2 # lines from my Pylons ini file sqlalchemy.default.pool_recycle = 3600 sqlalchemy.default.pool_size = 32 sqlalchemy.default.max_overflow = 1024 I think that the reason this happens is because this is not a stateful app, but rather a state-less web site. Every request to the site is a full but isolated execution of the app, and this makes me think that SQLAlchemy doesn't really have a Pool to work with. I'm rather flummoxed on this one. No one seems to have an answer other than pool_recycle - which is not working. Kind regards, Raoul Snyman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---