Skip to main content
Kill -9 Club
Sign in

connection pool

Databases

A set of database connections opened in advance and held on the client side: the application opens them at start-up and hands them out to requests, rather than connecting and disconnecting for every call. So the number to count is not one connection per instance. A Node client opens a pool, and the real total is pool size multiplied by number of processes: a pool of 10 in an application started as four instances holds 40 connections at idle, before the first visitor. max_connections defaults to 100, of which 3 are kept for the superuser — the application budget is 97, minus your own psql sessions. A deployment that starts the new processes before stopping the old ones doubles the total for a few seconds, and the server answers FATAL: sorry, too many clients already. That is a refusal, not a wait. Count in pg_stat_activity rather than assume.

Also written: pool, connection pooling