Databases · Estimate

A service runs 2,000 queries/s, and each query holds a database connection for 5 ms. On average, how many connections are busy?

medium Estimation

Answer

About 10 connections. In review, anything from 6.67 to 15 counts as right.

The worked estimate

Little's law: busy = rate × time held. 2,000/s × 0.005 s = 10 connections. A pool a few times that absorbs bursts; a pool of 500 adds nothing but load on the database.

Numbers: Numbers to know.

Review this in your daily deck All cards in Databases