Skip to content

Performance

Query Monitor on staging, not on a hot shop

Run Query Monitor on a staging copy so you can find slow queries without taxing your live shop.

Updated Aug 29, 20263 min read15 reads

Tags

Query Monitor on staging, not on a hot shop
Use Query Monitor on staging, not on a busy live shop

Query Monitor belongs on a staging copy of your site, not on a busy live shop. It is a developer plugin that lists every database query, HTTP request, and hook a page runs. That detail helps you find slow code, but the collection work itself uses CPU on every request. Run it where you can afford the cost, fix what you find, then keep production lean and cached.

What you are looking for

Open the toolbar on a slow page and look past the big total at the top. Duplicate queries inside a loop often mean a plugin is loading data one row at a time. A long query against postmeta can point to a missing index. Large autoloaded options slow every request before your theme even starts. A remote HTTP call inside the page will block until the other server answers. Object cache misses on keys you expect to hit are another common clue. Screenshot the slow row that matters, not the whole colorful bar.

How to run it safely on staging

Copy production into staging with WP Toolkit when you can. Enable Query Monitor only on that copy. Load the expensive URL both logged out and logged in, because logged-in traffic often bypasses the page cache and shows the real work. After you spot the problem, reduce the queries, improve the index, or stop running that plugin on the storefront. Turn Query Monitor off again when you are done. On production, rely on LSCache so anonymous visitors never pay for that pile. Query Monitor does not replace a page cache; it only explains why a cache miss hurts.

When staging cannot match the live shop

Sometimes staging has far fewer orders or posts, so the slow path never appears. On a VPS, a short window with the MariaDB slow query log is safer than leaving the toolbar on the live shop. Turn the log on, copy the offenders, then turn it off. Leaving a slow log at a zero-second cutoff fills disk the same way Query Monitor taxes CPU. Do not leave Query Monitor active on production for “just a week.” That week becomes a month, staff see the admin bar, collectors keep running, and the site feels slow for a reason you already introduced.

Share

Send this article

Need someone else to do this? Send them the link — the commands are in the article.

Tagged

Was this article helpful?

Be the first to rate this article.