Knowledge base · Studio 3T Desktop IDE

Want to Find Slow Queries? Check MongoDB Current Operations

By Kathryn Vargas · Updated

This article describes how to find slow running MongoDB queries using Current Operations. In Studio 3T 2023.9, Studio 3T introduced Query Profiler for a much faster way of finding, investigating, and fixing slow queries to improve MongoDB performance.

Download Studio 3T and try Query Profiler today for free.

currentOp is a MongoDB admin command that returns a document with information on operations in progress.

Studio 3T replaces the currentOp command with a Current Operations feature, which you can access by right-clicking on any collection in the Connection Tree.

View the current operations of any MongoDB collection in Studio 3T

This opens a new Current Operations tab which displays data for in-progress and expired ops – if you so choose.

Find a slow MongoDB query

An effective way of spotting slow MongoDB queries is to check the Show Only Slow Ops box.

You can define what “slow” is by choosing one of four default settings: 1, 3, 10 or 30 seconds. The queries that meet this criteria will appear as results – think of it as your collection’s slow query log.

Show slow MongoDB queries

Want to try it on your collection? Download Studio 3T to get started.

Kill long-running operations

Once you’ve identified your slow MongoDB queries, choose the operation(s) you want to cancel from the results. Then, click on the Kill operation button.

Kill long-running MongoDB operations

Show expired ops

In addition to current operations, you can also choose to show expired operations by checking the Retain Expired Ops box. Expired operations will appear greyed out.

Retain expired MongoDB operations

You can retain all expired operations or only those executed in the last 10 seconds, 30 seconds, 1, 2, 5, or 10 minutes.

Show own ops only

If there are multiple current operations running against your collection and you only want to show those you’ve started, check on the Show own ops only box.

Show your MongoDB operations only

Show system operations

To show system operations alongside user operations, check the Show Sys Ops box.

Show system operations alongside user operations

Change update frequency

You can also decide how often to refresh current operations:

Choose your update frequency

Filter current operations

To filter only a certain type of operation, click on the corresponding icon. From left to right, the options are:

Choose to show only certain current operations

  • n – none
  • u – update
  • i – insert
  • q – query
  • g – getmore
  • r – remove
  • k – killcursors

MongoDB current operations

The Current Operations feature in Studio 3T displays this data for all operation types:

  • opid
  • expired
  • host
  • desc
  • connectionId
  • client
  • clientMetadata
  • active
  • currentOpTime
  • secs_running
  • microsecs_running
  • op
  • ns
  • command
  • planSummary
  • numYields
  • locks
  • waitingForLock
  • lockStats

MongoDB current ops


Want to improve MongoDB query performance? These tutorials might help:

With your consent, we and third-party providers use cookies and similar technologies on our website to analyse your use of our site for market research or advertising purposes, including personalized advertising (“performance”), to provide you with additional functions (“functional”), and to show content from social media platforms, such as embedded videos (“social media”). This may result in the creation of pseudonymous usage profiles and the transfer of personal data to third countries, including the USA, which may have no adequate level of protection for the processing of personal data. Please choose for which purposes you wish to give us your consent and store your preferences by clicking on “Accept selected”. You can find further information in section 9 of our Privacy Policy.

Manage consent preferences