You can control the amount of time before your connection is
terminated with the MySQL parameter wait_timeout - although addressing
the fundamental problem of the app handling dropped connections should
obviously be addressed. In higher load environments with MySQL it may
actually behoove you to reap and recycle connections more frequently
rather than hold thousands of them open as you will typically be able
to scale better and handle higher concurrency that way. You also want
your app to be able to handle dropped connections in case you ever
want to build an HA database system behind the app, since connections
through a load balancer or other thing may want to be reaped more
rapidly than the app would expect.

But as a stop-gap measure (and if you aren't expecting data rates in
the 1000's per second), you can set wait_timeout (set in seconds) to
something hideously high.

Monty

On 10/18/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> pool_recycle is an integer number of seconds which to wait before
> reopening a conneciton.  However, setting it to "True" is equivalent to
> 1 which means it will reopen connections constantly.
>
> check out the FAQ entry on this:
>
> http://www.sqlalchemy.org/trac/wiki/FAQ#MySQLserverhasgoneaway/psycopg.InterfaceError:connectionalreadyclosed
>
> note that the recycle only occurs on the connect() operation.
>
> also turn on "echo_pool=True" so that you can see the connections being
> recycled in the standard output
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to