← Back to 30-Day Challenge

🔍 Bottleneck Hunting · Days 19–24

Day 19: Connection Pool Exhaustion

Objective

Drive enough concurrency to starve the app or DB connection pool.

Scenario

Increase load until response time spikes while CPU remains low. Check connection pool metrics. You will see requests queuing for a free connection.

Metrics to Watch

pool active/idle/waitqueue time

When It Clicks

Requests queue for connections - latency climbs while CPU stays low.

Solution

Ramp users past the pool size (e.g. if the DB pool is 20, ramp to 30-40 users). The signature: response time climbs sharply while CPU stays flat - threads are idle, waiting for a free connection. In JMeter check the Active Threads chart vs Response Time chart - they diverge at the pool limit. To confirm: look at your DB or app server connection pool metrics (HikariCP exposes 'pool.wait' via JMX/Prometheus). Fix by increasing pool size or reducing per-request hold time, not by adding more app servers.

Reflection

Did you find a case where high latency did not mean high CPU? What was the real cause?

Deliverable

A script tuned to expose connection pool limits.

⚠️ Never run load tests against infrastructure you do not own or have explicit written permission to test. Always use a dedicated test environment. Unauthorized load injection can cause outages, trigger legal liability, and violate terms of service.