> I attached to this mail patch which is fixing both problems: correctly
> reports error to the client and calculates number of idle clients).
>
Yes, this works much better with max_sessions=1000. Now it's handling the
300 connections on the small server. n_idle_clients now looks accurate
with the rest of the stats here.
postgres=# SELECT n_clients, n_backends, n_idle_backends, n_idle_clients
FROM pg_pooler_state();
n_clients | n_backends | n_idle_backends | n_idle_clients
-----------+------------+-----------------+----------------
150 | 10 | 9 | 149
150 | 10 | 6 | 146
Ryan Lambert
>