Documentation

Query Monitor & Profiler

Query Monitor

Monitor active database operations in real-time. Identify long-running queries, analyze performance, and terminate problematic operations.

Note: Admin access to the admin database is required to view all running queries. Without admin privileges, you'll only see operations on databases you have access to.

Query Monitor interface with stats header, filters, and operations list
Video QMON02 Using the Query Monitor - filtering by runtime, reviewing slow queries, and killing a problematic operation

Getting Started

  1. Connect to your MongoDB database with admin access
  2. Open the Query Monitor from the navigation menu
  3. View active operations and use filters to find specific queries
  4. Terminate problematic queries with the Kill button

Interface Overview

Statistics Header

Three metrics at the top update in real-time:

  • Active Queries - Number of running operations matching your filters
  • Average Runtime - Average execution time across visible queries (in seconds)
  • Killed Today - How many queries you've terminated this session

Filter Controls

  • Runtime Filter - Show only queries running longer than a threshold. Use preset buttons (10s, 30s) or enter a custom value.
  • Database Filter - Select which databases to monitor. Badge shows selected count (e.g., "3/5").

Operations List

Each operation displays:

FieldDescription
ConnectionMongoDB connection name where the query is running
NamespaceDatabase and collection (format: database.collection)
CommandThe query being executed
RuntimeExecution time with progress bar (maxes at 60s visually)
Single query card showing connection, namespace, command, runtime, and Kill button

Filtering Operations

Database Filter

Click the "Databases" button to open the selection dialog:

  • Check/uncheck individual databases
  • Select All - Include all databases
  • Clear All - Deselect all (shows no operations)

Runtime Filter

  1. Enable the checkbox next to "Runtime ≥"
  2. Enter seconds or use presets: 10s (moderately slow) or 30s (very slow)
  3. Click X to clear and see all operations

Tip: Combine filters - filter your production database with 10s runtime to spot performance issues quickly.

Terminating Operations

Video QMON04 Killing a query - reviewing the confirmation dialog and verifying termination
  1. Find the operation in the list
  2. Click the red Kill button
  3. Review the confirmation dialog (shows user, command, warning)
  4. Click Kill Query to confirm or Cancel to abort
Kill confirmation dialog with command preview and warning

Warning: Killing a query immediately stops the operation and cannot be undone. The client application will receive an error. Verify you're terminating the correct query before confirming.

Empty States

  • "No Databases Selected" - Click Databases filter and select at least one
  • "No Long-Running Queries" - No queries exceed your runtime threshold
  • "No Active Queries" - Database is idle

Common Use Cases

  • Finding slow queries - Use 10s or 30s runtime filter, review the command, optimize or add indexes
  • Troubleshooting performance - Check for blocking queries when users report slowness
  • Stopping runaway queries - Kill unoptimized queries before they impact other users
  • Multi-database monitoring - Use database filter to switch between dev/staging/production
  • Baseline analysis - Monitor during normal operation to recognize abnormal patterns later

Tips

  • Start with 10s filter to catch moderately slow queries worth optimizing
  • Watch average runtime over time - gradual increases indicate growing data or degrading indexes
  • Check namespace before killing to understand which collection is affected
  • Copy the command before killing for later analysis
  • High "Killed Today" count suggests underlying issues needing investigation

Ready to try VisuaLeaf?

Download and start managing your MongoDB databases with ease.

Download Free Trial