Staff / expert · MongoDB with Go
MongoDB under contention
Why does increasing maxPoolSize fail to fix p99?
Try explaining this aloud before opening the answer. State your assumptions and trace a boundary case.
Reveal a strong answer
A pool is a client-side concurrency gate, not server throughput. Larger pools may increase active queries, lock/storage pressure and memory while moving the queue to the database. Multiply the setting by all clients and replicas.
Separate server selection, pool checkout, query execution, response decoding and application queue time. Inspect query plans, index selectivity, document sizes, hot-key write contention and retry amplification.
Bound admission and operation deadlines, reduce query work and choose indexes from the workload. Validate durability/read preference choices against business correctness before trading them for latency. Use a realistic load test with failures and saturation metrics.
Common trap
Turning every retry and pool limit upward can create a positive feedback loop during an outage.
Try it
A deployment doubles replicas and database CPU becomes saturated. What changed even with identical per-pod traffic?
Worked solution
Total admitted work and aggregate connections may have increased, and retries may multiply demand. Enforce a database-wide capacity budget, inspect plans and throttle overload. Scaling stateless pods cannot create storage-engine capacity.
Change the constraint
How would you distinguish a hot-document write bottleneck from a missing-index scan?
How did you do?
Self-assessment, not a compiler pass or interview score. Explain the reasoning unaided before marking understood.
Not marked. Progress stays on this browser, separate from course completion.
Primary references
Checked 2026-10-20. Use documentation for your pinned runtime, driver and tool version.