Available — part-time slots from Q4 2026 UK · Remote BST · GMT+1
All fixes
F/03 9 min read reviewed Sep 2026· Strapi 5

Knex: Timeout acquiring a connection. The pool is probably full

TL;DR

The error is Knex: Timeout acquiring a connection. The pool is probably full. Under load the app stops responding and the logs fill with it. The counterintuitive part is that this is almost never CPU load. It is connection starvation, and the single best tell separates it from a genuinely overloaded app in one glance: check CPU. An app that is dead with CPU near zero is out of database connections, not out of compute. This is the structural sibling of a slow API, and worth reading alongside Why is your Strapi API slow?.

00· Before anything

First: check CPU

This is the best single tell in the whole category. When the pool timeout appears, look at CPU on the application instances. An app that is unresponsive with CPU near zero is starved of database connections, not of compute; a genuinely overloaded app runs hot. That one glance tells you whether you are on this page.

From there it is arithmetic. Multiply your replica count by pool.max and compare it against the database's max_connections. If the total exceeds the ceiling, you have found it. If it is comfortably under, go looking for a fan-out query.

sql
-- the database's ceiling
SHOW max_connections;

-- your usage: replicas × pool.max must stay under it

Do this before you raise pool.max. Increasing the pool on every replica is the most common way to make this worse: more replicas, each opening a bigger pool, is exactly what exhausts the database's ceiling.

Likely causes · The order I check them

bars = diagnostic order from experience, not measured frequency

Cause 01 of 05

Horizontal scaling: replicas × pool.max exceeds the database ceiling

Symptom

Fine on one instance, fails once you scale out, and bites hardest when everything restarts at once and every replica opens its pool together.

How to confirm

Replica count times pool.max against the database's max_connections. Over the ceiling is your answer.

Why it happens

Each instance opens its own connection pool. Nothing coordinates them, so total connection demand is replicas times pool.max, which quietly passes the database's limit.

The fix

Size pool.max in config/database so that replicas times the pool stays comfortably under max_connections, leaving headroom for migrations and admin connections. Scale the pool down as you scale replicas up, not the other way around.

06

On Strapi Cloud the connection pool is not customer-tunable and pool usage cannot be monitored. The diagnostic path there is narrower: correlate the exact minute of the timeout against what else ran, since you cannot resize the pool or watch it fill.

07

If it's none of these

If CPU is high rather than near zero, you are not connection-starved, you are genuinely loaded, and the slow-API diagnosis applies instead: unbounded population, missing indexes, unpaginated collections. Start with Why is your Strapi API slow?. And confirm the database instance itself is not undersized: a small database with a low max_connections ceiling hits this far sooner than the app's pool settings suggest.

Common questions

Diagnosed everything and still stuck?

S/01 — Performance & Architecture Rescue.

A fixed-scope week that finds the cause and fixes what's causing it.