On Thu, Sep 25, 2014 at 5:33 AM, Thierry Florac <tflo...@gmail.com> wrote:
> Hi,
>
> I have a multi-threaded web application using SQLAlchemy connections pool.
> As soon as a connection is opened, it's maintained opened in the pool even
> if it's not used anymore. On a long run, this can consume too much
> unnecessary connections and database server resources.
>
> So what I'm actually looking for is a way to close a given connection which
> is returned to the pool if it wasn't used for a given amount of time...
>
> Any idea ?
>

A while back when I wanted this, I ended up subclassing QueuePool and
using that subclass with the engine.

Sadly, I don't have the code at hand. But I have managed without it
since then, so I'm wondering if this is really an issue. Currently,
I'm using postgres with pgbouncer, and this last one can handle
separating the idle from the active very well.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to