All articles

MySQL

MySQL at 100% CPU: A Triage Playbook

Sep 2, 2026 mysql · cpu · performance · troubleshooting

A field-tested sequence for diagnosing CPU saturation on production MySQL before you restart anything.

When a MySQL instance hits 100% CPU, the instinct is to restart. Resist it: a restart resets the evidence. CPU saturation is a symptom, and the source is almost always discoverable from live signals — processlist sampling, performance_schema digests, and OS metrics.

This playbook is the same sequence we run during emergency engagements, compressed into five steps you can execute without changing a single line of application code.

Sample the processlist, don't glance at it

A single SHOW PROCESSLIST is a photograph; saturation is a video. Sample the processlist every second for several minutes and aggregate. The queries that appear again and again with big examined-rows counts are your suspects — not the one that happened to be running at the moment you looked.

Rank by total cost, not per-run latency

A 40ms query running 10,000 times per minute owns more CPU than a 2s query running twice. Use the events_statements_summary_by_digest table and rank statements by SUM_TIMER_WAIT. The top five usually explain the saturation — and each has a fix: an index, a rewrite, or a parameter correction.

Check what the CPU is actually doing

Not all CPU is equal. User-space time spent in query execution points at statements; system time spent in I/O syscalls points at a buffer pool that is too small for the working set; spin time points at lock contention. A quick top or pidstat read tells you which story you are debugging.

Tags

mysql cpu performance troubleshooting

Related articles

Work with Burj

Your database deserves engineering, not guesswork.

Tell us what is slow — CPU, queries, migrations, or cost — and we will scope the smallest safe fix.

Plan an engagement