]> git.ipfire.org Git - thirdparty/psycopg.git/commit
Use the connections in the pool uniformly
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 22 Feb 2021 03:20:33 +0000 (04:20 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 12 Mar 2021 04:07:25 +0000 (05:07 +0100)
commitebbcab285a98e7eab56c08b6ef0c7cb5d3b943c7
treebac07a4ef9039426a16e19ac9e301f9facc692c6
parent1831b8f0fff198fc557b0a7c7af85dc8aa12ab0e
Use the connections in the pool uniformly

I feel this is a better use than using some more than other (e.g. in
term of bloat of the connections associated with the resources) and
gives a more predictable performance of the connection (there won't be
some cold, some hot).

Now there aren't really "unused connections" to single out in order to
shrink the pool. So keep a tally of the number of connections unused and
use a worker thread to close some if there are above minconn unused in a
period.
psycopg3/psycopg3/pool.py
tests/test_pool.py