AGhosted Plugin Picks: Query Monitor

WordPress Plugin PicksIf you’re like me, you have enough WordPress know-how to be productive, but can be overwhelmed by too many technical details. We’ve all had that moment when working on our WordPress site where we find a page that loads slowly, but we aren’t sure why. Many factors may contribute to slow page loads, and that makes finding the answer complicated.

For troubleshooting, we try to recommend tools that provide valuable information without being overwhelming with other, unnecessary numbers. Query Monitor is one tool we’ve found that balances useful debugging and performance information with ease-of-use.

Getting started with Query Monitor

When you install Query Monitor, you’ll see a new set of numbers along your top toolbar (see image below).

Query Monitor section in top toolbar

Here’s how to interpret those numbers:

  • 0.53s – That’s the amount of time it took to generate the full page.
  • 12.73MB – The size of the page, or the “memory usage”.
  • 0.0128s – The amount of time it took to query your database for this specific page.
  • 55Q – The number of queries to the database on this page.
Query Monitor Dropdown
The Query Monitor toolbar dropdown menu

For the most part, if your site is running well, these numbers are interesting, but not important to track. When viewing a slow page, however, these can be useful in helping you track down the source of the problem.

If you click on the Query Monitor numbers in the top toolbar, you’ll get a dropdown menu listing the reports you can view. Click on any given item in the dropdown to view that specific report, or scroll down the page to scan more detailed information.

Using Query Monitor

Let’s walk through the scenario where you have a slow-loading page without any obvious culprit. You can tell the page is slow, but you’re not sure of the cause. It could be database queries, a problematic plugin, or some other server problem. With Query Monitor, you can easily check on the database queries by clicking the Queries by Component menu option. This provides an overview of the quantity and performance of the database queries within WordPress (Core) and your various plugins:

Queries by Component Section

Be sure to consider the bigger picture. Although the Plugin: wordfence entry above creates a lot of queries and loads 10x slower than most of the other plugins, the entire database impact is only 0.0266 seconds. That’s not a concern! Even if one plugin’s queries are a lot slower than others’, the total database impact ultimately determines whether your database queries are causing the page slowness.

You can also check this Queries by Component section before and after temporarily deactivating a potentially problematic plugin. This technique also works when enabling a brand new plugin to see what impact it may have on your database queries and their run time.


When the database ISN’T the problem

So you’ve used Query Monitor to determine that your slow pages don’t have any problematic database queries on them — now what?! As we mentioned in the opening, there are many factors that may contribute to page slowness. As such, we need a toolbox full of tools we can use to diagnose the problem. Read our past performance-related posts and keep your eyes open for new ones here on the AGhosted Blog!

Do you use Query Monitor? If so, we want to hear how it is working for you.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.