retrystorm · Learn · Interview practice · Glossary · Components

Home › Interview practice › Too many connections

Too many connections

A slow query holds connections until the database runs out.

Inkwell Blogs pages now show related posts. The query behind them is slow, about 60 ms, mostly spent waiting on disk. Since it shipped, about one page in four fails with "too many connections", while the database's CPU sits at about half.

Workload

A steady 4 000 rps, 95% reads / 5% writes, for 15 seconds, over 100 000 posts.

Your move

The app tier and the query time are fixed. Choose the database: its tier and its read replicas. Each node accepts a limited number of connections (small 100, medium 200, large 400, xlarge 800), and bigger ones cost more.

About · Contact · Privacy · Terms of use