Slow Query Analyzer for MongoDB®

ScaleGrid's Slow Query Analyzer for MongoDB® database helps you easily identify problem queries in your cluster running in the cloud.

ScaleGrid DBaaS for MongoDB® database provides a Slow Query Analyzer tool to help you quickly identify slow-running queries in your cluster running on ScaleGrid.

Create a Slow Query Analysis Heat Map

  1. Login to the ScaleGrid Console.
  2. Navigate to your Cluster Details page for MongoDB® page.
  3. Click on the 'Slow Queries' tab.
  4. Select the server you're interested in analyzing.
  5. Select the time range. By default you can pick last hour, 3 hours, 6 hours, 24 hours, or customize a time range.
  6. Click the Profile button to analyze your MongoDB® slow queries.
1760

Once the slow query report processes, you’re presented with a heat map of all the queries in your system for your selected time range. All queries of the same type have the same color so you can get a good idea of the clustering of the different queries running in your system.

The X-axis is for time, and the Y-axis is the duration of the queries. The higher up the queries, the slower it is.

Hover or click over one of the bubble to get an idea of what sort of query is associated with it. You can also zoom into a particular time range to understand in detail what is going on over that period of time.

Top Read Load Generators for MongoDB®

Use the Top Read Load Generators pie chart on the right to quickly identify the top queries causing read load in your system. This is an easy way to identify queries that are typically not indexed.

478

Slow Queries Table Report for MongoDB®

The Slow Query Details table at the bottom allows you to sort and search through your queries, and breaks down your data into the following categories:

  • Type: Type of query.
  • Query: The query in your system.
  • Database: Sort queries by database.
  • Collection: Sort queries by collection.
  • Count (default): Sort queries by frequency.
  • nScanned (Avg): Sort queries by number of items (documents or index entries) examined.
  • Duration (Avg-ms): Sort queries by duration.
  • Response Length (Avg-bytes): Sort queries by response length.
  • nReturned (Avg-Docs): Sort queries by the number of documents returned by the operation.
  • Read Lock Time (Avg-ms): Sort queries by read lock time.
  • Write Lock Time (Avg-ms): Sort queries by write lock time.
1485

Filter MongoDB® Queries

Customize which queries show up in the heat map, or create a specific heat map for a particular query. Simply select the checkbox next to the particular query you’re interested in, and only those queries will show up on the heat map.

You can also filter your queries based on a particular string. For example, if you only want to analyze the 'SELECT' queries, enter this string into the search box above the table and this will filter the queries to only show those with SELECT.

1479

Export Your Slow Query Analysis Data for MongoDB®

You can easily export all of your slow query analysis data for MongoDB® database to review with your team or analyze further outside of the ScaleGrid platform. Simply click the "Export" button above the Slow Query Heatmap to download your data as either a PDF or CSV file.

  • Download CSV: Export in a CSV format to open in excel for further analysis, and share with your team and do any sort of offline analysis that you want.
  • Download PDF: You can also export as a report in PDF format to share with your team for a more detailed view of the slow query analysis.

On the top right, you can also view the previous slow query analysis that were run on your system and analyze through any of the above methods.

If you have any questions, please reach out to us at [email protected].