MongoDB CPU maxes after deploy

On-call incidentMedium30 min

Your task

At 15:00 your MongoDB primary's CPU hits 95% and stays there; query latency across the whole app degrades, not just one feature. mongostat shows a surge in scanned documents far exceeding documents returned, the page-fault and disk-read rate is up, and the working set no longer fits in RAM. A product change last week added a new filter on an existing collection (filtering by a 'region' field). No index was added for it. Traffic is normal. How do you triage and mitigate?

It covers

  • Cpu saturation
  • Scan
  • N plus one