Skip to main content

PoolConfiguration

Extends ConnectionConfiguration and lightning-pool's PoolConfiguration.

KeyTypeDefaultDescription
pipelineMaxQueriesnumber100How many of Pool.query()'s one-shot queries may share a single pooled connection at the same time. PostgreSQL correlates responses to requests by order, so several queries can be in flight on one connection at once, each with its own Sync and therefore its own error boundary — max then becomes a ceiling on connections rather than on concurrent queries. Set to 1 for the older behaviour, where Pool.query() holds a connection exclusively for the duration of each query. Connections handed out by acquire() are never shared, whatever this is set to, so transactions, cursors and prepared statements are unaffected
pipelineMaxConnectionsnumberthe pool's own maxHow many pooled connections the pipelined path may borrow at once. Borrowed connections are handed straight back the moment they go idle, so this is a ceiling on how wide a single burst may fan out, not a reservation — lower it to keep connections free for acquire() while a burst is running
acquireMaxRetriesnumber0Maximum number that Pool will try to create a connection before returning the error
acquireRetryWaitnumber2000Time in millis that Pool will wait after each try
acquireTimeoutMillisnumber0Time in millis an acquire call will wait for a connection before timing out
fifobooleantrueSpecifies whether resources are allocated in first-in-first-out order
idleTimeoutMillisnumber30000The minimum amount of time in millis that a connection may sit idle in the Pool
houseKeepIntervalnumber1000Time period in millis that Pool will make a cleanup
minnumber0Minimum number of connections that Pool will keep
minIdlenumber0Minimum number of connections that Pool will keep in idle state
maxnumber10Maximum number of connections that Pool will create
maxQueuenumber1000Maximum number of requests that Pool will accept
validationbooleantrueIf true, Pool tests the connection on acquire

See the Connection Pooling guide for usage.