Knex connection pool timeout appearing only in production
0 reputation · 11 Dec 2025, 11:31 UTC
Symptom
Knex throws a KnexTimeoutError when trying to acquire a connection, but the error only surfaces in the production environment while the same configuration works locally.
The goal is to decide whether the timeout originates from connection‑pool exhaustion or from an SSL/TLS handshake failure that is present only in production.
Because both conditions produce the same timeout symptom, the diagnosis must rely on distinguishing signals such as pool usage metrics versus connection‑level error codes.
- Which pool‑state metric (e.g., numUsed, numFree, numPendingAcquires) should be inspected first to tell apart saturation from SSL failure?
- How can those metrics be gathered safely in a live production system without adding noticeable overhead?
- What TLS‑specific error codes or handshake alerts would indicate an SSL misconfiguration rather than a pool limit?