You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to optimise the size of the connection pool ( I know its a much broader topic).
I've been playing around with setting a really low timeout, and looping while counting the timeouts (this is also meaningful only in the long running mean) .
My app has no use for persistent connections/transactions and a pool is used to allow for a higher throughput and every "fetch" is called on the pool instance.
any low hanging fruits here or should I try to rebuilding the library with some tracing on the acquire context?
What is the correct way to calculate busy connections? Is this the correct way?
used_connections = sum(
holder._in_use is not None
for holder in pool._holders
)
I am trying to see metrics how are being used asyncpg connections, and this metric sometimes show very strange values (much more then Poolmax_size value for example)
Activity
elprans commentedon Nov 28, 2018
There's no public method, but you can check
pool._queue.qsize()for the number of free connections in it.alvassin commentedon Dec 25, 2019
@elprans thank you.
What is the correct way to calculate busy connections? Is this the correct way?
I am trying to see metrics how are being used asyncpg connections, and
this metric sometimes show very strange values (much more thenPoolmax_sizevalue for example)