> I'm still having this problem with MySQL (both 4.1 and 5.0), SA
> (tested with both 0.2.8 and 0.3.1) and TurboGears 1.0b1.
Almost the same for me (MySQL 5.0.22, SA 0.2.8 and 0.3.1, using CherryPy).
Using pool_recycle works nice on a non-high load environments. But while I
benchmark my app (using siege or ab), this always produces "Lost connection
during MySQL query...", and sometimes "MySQL server has gone away...".
Note the version of MySQLdb is important: using 1.2.2b1 (didn't tested the
last 1.2.2b2) can reduce those errors, but not completely though. Also,
MySQLdb is not thread-safe, so using it in a multithreaded environment can be
painful... (but I'm sure that's transparent using TG).
Since SA 0.2.4 (pool_recycle did not exist at this time), I use a specific
pool, derived from the QueuePool class, which *always* check the current
checked-out connection is valid, using connection.ping() (MySQL specific, I
think not all DBs support this). I'm still using my pool as of 0.3.1, to
prevent those kind of errors.
I didn't find out why this occurs: having a test-case is very difficult. I'd
also investigated the way the app access MySQL. IIRC, while using a socket,
if a connection is timed-out, reaccessing the server
automatically "regenerate" the connection (well, actually, I've not observed
this behavior for all the mysql servers I use), without producing those
errors. I have this kind of lines in MySQL logs when this occurs:
Connect [EMAIL PROTECTED] on dev
blablabla
Well, that's a lot of obscure observations... without a clean solution ! But
maybe someone will have some ideas...
Cheers,
--
Sébastien LELONG
sebastien.lelong[at]sirloon.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---