Too many connections

  • Fix
  • Signal 16

Difficulty 3 of 5

Twelve API replicas each open 20 database connections. The database allows 200. Remove connection errors and keep p99 below 200 ms with at most five edits.

0:00. The database rejects connections during the API scale-out. Graph: open connections hit 200 and stay flat.

Play level

VPS · 8 vCPU · 32 GB60 USD/moHTTP/2SQLUsers3,000 req/sAPI serverPostgres2 vCPU · 4 GB
VPS60 USD/moHTTP/2SQLUsers3,000 req/sAPI serverPostgres2 vCPU · 4 GB
The board at the start of the level
One server boardDrag or use arrow keys to change the load

280 req/s · CPU 70% · mean 22 ms

Goals and limits

Error rate
none
p99 latency
under 200 ms
Monthly cost
under 70 USD/mo
Parts you can add
Connection pooler
Part limit
12
Edit limit
5
Hosts
8 vCPU · 32 GB
Traffic
3,000 req/s

Concepts

How players did

Player results load from the server.