🗄️database / postgresql

PostgreSQL Connection Pool Exhaustion

middle25 min🏢 E-commerce platform (Series B, ~50M MAU)
PostgreSQLHikariCPJavaSpring BootConnection Pooling

Tech Stack

  • Java 11
  • Spring Boot 2.7
  • PostgreSQL 14
  • HikariCP 4.0
  • Kubernetes
🚨

Incident Scenario

It's 14:30 on Black Friday. Your monitoring alerts fire: response times have spiked.
The load test you ran yesterday showed the system handles 800 RPS fine.
Right now you're at 650 RPS and everything is degrading.
Your on-call shift starts in 2 minutes. Find the bottleneck.

🔍 Investigation Artifacts

Reveal artifacts one by one. Each clue brings you closer to the root cause.

📊
Clue #1 · graph
Response Time Over 30 Minutes
💡 Notice the sharp degradation after exactly 15 minutes of stable load
📋
Clue #2 · log
Application Logs (Last 100 lines)
💡 Look for connection-related messages and their timestamps
🔍
Clue #3 · query
PostgreSQL Active Connections Query
💡 What does pg_stat_activity show about connection states?
⚙️
Clue #4 · config
HikariCP Config + OrderService Code
💡 Look at what happens inside the @Transactional method — is there anything that should not be there?