Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for MySQL Difficulty: Intermediate ClaudeChatGPTCursor

MySQL InnoDB Buffer Pool Warmup Prompt

Configure buffer-pool dump/restore so a restarted or failed-over MySQL instance serves warm-cache latency immediately instead of a cold-cache stall.

Target user
DBAs and SREs reducing post-restart and post-failover latency spikes
Difficulty
Intermediate
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior MySQL/MariaDB DBA who eliminates cold-cache latency after restarts and failovers. You understand innodb_buffer_pool_dump_at_shutdown, innodb_buffer_pool_load_at_startup, innodb_buffer_pool_dump_pct, innodb_buffer_pool_load_now/dump_now, ib_buffer_pool, and how buffer-pool warmth affects p99 latency immediately after a node starts serving traffic.

I will provide:
- Current values of the buffer-pool dump/load variables and innodb_buffer_pool_size: [PASTE]
- The scenario driving cold-cache pain (routine restart, deploy, or failover promotion): [DESCRIBE]
- Storage type and whether multiple instances share the backend: [DESCRIBE]
- Observed symptom (e.g. p99 latency spike for N minutes after restart, disk read saturation): [DESCRIBE]
- Dataset size vs buffer-pool size (does the hot set fit?): [DESCRIBE]

Work through this:

1. **Confirm warmup is the right lever.** Establish that the latency spike is cold-cache (high Innodb_buffer_pool_reads / disk reads right after start that fade as the pool fills), not a query or plan problem.
2. **Set dump-on-shutdown and load-on-startup** correctly, and choose innodb_buffer_pool_dump_pct so the dump captures the genuinely hot pages (the most recently used fraction) without bloating the load.
3. **Handle failover specifically.** A promoted replica may never have been "shut down" to produce a fresh dump — recommend periodic innodb_buffer_pool_dump_now (or a scheduled dump) so a warm page list always exists to load on promotion.
4. **Pace the load I/O.** Address the risk of the startup read storm on shared storage; recommend timing and any throttling so warmup does not starve the newly promoted primary or neighbors.
5. **Keep the dump fresh.** Recommend refreshing the dump on a cadence that tracks workload/schema changes so warmup loads pages that are still hot.
6. **Verify.** Show how to confirm the load ran (Innodb_buffer_pool_load_status), measure the reduced cold-start window, and confirm the hot set actually fits the pool.

Output: (a) Confirmation the symptom is cold-cache with evidence, (b) Recommended dump/load settings and dump_pct rationale, (c) Failover-specific dump cadence, (d) Load-pacing plan for shared storage, (e) Verification and refresh cadence.

Guardrails: confirm the hot working set fits innodb_buffer_pool_size before expecting warmup to help — warmup cannot fix an undersized pool; pace load I/O so it does not starve a freshly promoted primary or shared neighbors; keep the dump fresh so warmup does not load stale pages.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Why this prompt works

A restarted or newly promoted MySQL node with an empty buffer pool serves every query from disk, producing a latency spike that can last many minutes and looks alarming on dashboards. Buffer-pool dump/restore fixes this, but only if it is configured for the scenario that actually hurts. This prompt first confirms the symptom is genuinely cold-cache — rising Innodb_buffer_pool_reads that fade as the pool fills — rather than a query problem that warmup cannot touch, which stops engineers from applying the wrong fix.

The failover angle is where most setups fall short and where this prompt adds real value. A replica that gets promoted was never gracefully shut down, so it has no fresh dump to load and comes up cold at the worst possible moment. By recommending a scheduled innodb_buffer_pool_dump_now, the prompt ensures a warm page list always exists to restore on promotion, turning failover from a latency cliff into a smooth handoff.

The guardrails keep expectations honest. Warmup cannot rescue an undersized buffer pool, and an aggressive startup load can itself saturate shared storage right when the new primary needs headroom. By forcing confirmation that the hot set fits the pool and demanding a load-pacing plan, the prompt makes sure warmup helps rather than trading one stall for another.

Related prompts

More MySQL prompts & error guides

Browse every MySQL prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.