PostgreSQL

PostgreSQL%20Docs 2088E9?logo=quickLook&logoColor=white Pgpool%20Docs 2088E9?logo=quickLook&logoColor=white Awesome%20PostgreSQL FC60A8?logo=awesomelists&logoColor=white PostgreSQL%20Helm 0F1689?logo=helm&logoColor=white

Pgpool restarts due to "Sorry, too many clients already"

In order to guarantee that the application connection requests are never rejected, and that the connection requests wait until a database connection is available, the following condition should be met:

max_pool * num_init_children <= (max_connections - superuser_reserved_connections)

You can check max_connections and superuser_reserved_connections in PostgreSQL with these queries:

SHOW max_connections;
SHOW superuser_reserved_connections;

Keep Pgpool connections at stable level

Without below numbers, idle connections were slowly increasing and had been reaching the limit of max_connections=400 (memory usage was also quickly increasing):

  • connection_life_time=60

  • child_life_time=60