Advanced System Design Fundamentals
0% completed
Connection Pooling and the Database Thundering Herd
Here are three settings from the order service of a food delivery app. Each one looks reasonable on its own.
db_pool_size = 25 # connections each instance opens at start
request_timeout = 2s
retry_on_timeout = true # resend at once
Now multiply them by the 40 instances the service runs at dinner, and let the autoscaler add more. The Postgres database can then fail in its busiest minutes, even though each query is fast. The cause is the connections and the retries, not the queries. This lesson explains why, and it describes the pooling layer that prevents it.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%