Predict the output
4 servers × 9 gunicorn workers × a pool of 5 connections each. How many database connections at peak?
servers, workers, pool = 4, 9, 5
print(servers * workers * pool)Hint 1 of 1
Multiply all three.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A 180
Correct. Multiply every layer; this is often more than the database is configured for.
Each server runs its own 9 workers, and every worker process keeps its own pool. Connections multiply at each layer: 4 × 9 × 5 = 180. Compare that with the database's max_connections.
Why not the others?
- B
45. That's one server. - C
20. That ignores workers. - D
36. That counts servers × workers but leaves out each worker's pool of 5.