[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] Give unused DB connections back to the pool.



On Tue, 13 Apr 2010, Bernd Zeimetz wrote:

> Pooling is only able to work if unused connections are given back asap.
> While this patch is only a quick fix, it should fix the
> too-many-open-connections error (assuming that DBUtil works as
> expected).

For now I've configured the web application so that it should never run
more threads than it is allowed to have DB connections.

We probably should hack up the DB pool thing so that it only opens a
given number of connections and then blocks (with an appropriate
timeout) until a connection is given back again.  The pool
implementations that come with psycopg seem to not do that, i.e. they
will simply throw a pool-exhaused exception.

-- 
                           |  .''`.  ** Debian GNU/Linux **
      Peter Palfrader      | : :' :      The  universal
 http://www.palfrader.org/ | `. `'      Operating System
                           |   `-    http://www.debian.org/


Reply to: