Skip to main content
Metrics type: Key MetricsCategory: Performance

At a glance

How many database operations took longer than the slow-query threshold in the last 15 minutes. MongoDB’s database profiler records any operation whose execution time exceeds the slowms setting (100 milliseconds by default), capturing the query shape, the collection, the duration, and whether an index was used. This card counts those profiler entries over a rolling 15-minute window. A handful of slow operations is normal on any busy cluster; a rising count is the earliest, cheapest signal that something is degrading, whether a missing index, a collection scan, lock contention, or cache pressure, usually well before it shows up as user-visible latency or errors. The card raises an alert at >10: more than ten slow operations in fifteen minutes means the slowness is no longer an occasional outlier but a pattern worth investigating now.

Calculation

The value is a count of profiler documents over the slow threshold within the window:
Two settings govern what lands in the count:
  • slowms is the threshold in milliseconds above which an operation is considered slow. The default is 100ms. It is set per mongod (and visible via the profiling status), so the card reflects whatever threshold the deployment actually uses. If a team has lowered slowms to 50ms to catch more, the count will be higher; if raised to 200ms, lower.
  • The profiling level controls what gets written. Level 1 logs only operations slower than slowms (the usual production setting and exactly what this card needs). Level 2 logs every operation regardless of speed; the card still only counts those over slowms. Level 0 disables profiling, in which case system.profile is empty and this card reads zero.
The profiler writes to a capped collection (system.profile, 1 MB by default), so on a deployment generating a very high rate of slow operations, the oldest entries can be overwritten before they are read. In that scenario the true slow-op rate is higher than the count shown; the card surfaces a lower bound. This is rare in practice because a deployment producing enough slow ops to roll a 1 MB cap inside 15 minutes is already deep in the red on the alert. This card is the leading indicator for the Performance category. It moves before Query Latency p95 (ms) and well before Query Error Rate %, because a query is slow long before it is slow enough to time out and error.

Worked example

A platform team runs a replica set behind a catalogue and search service. Profiling is at level 1 with the default slowms of 100ms. Snapshot taken on 16 Apr 26 at 14:05 BST. The card reads 17 slow ops and turns red. The team drills in:
  1. One query shape accounts for most of it. Fourteen of the seventeen slow operations are the same find on the products collection filtering by tags. The profiler entries show COLLSCAN in the plan, meaning every one of these queries is scanning the whole collection because there is no index on tags. This lines up with COLLSCAN Operations (24h) also climbing.
  2. Why now? A marketing change started linking to tag-filtered product pages an hour ago, so a query shape that was previously rare is now running on every page load. The collection is large enough that the scan crosses 100ms every time.
  3. The fix is an index, not more hardware. Each slow find reads the entire products collection from cache (or disk if it spills), which is why WiredTiger Cache Hit Rate % is also dipping: the repeated full scans are churning the working set. An index on tags turns each scan into an index lookup, dropping the per-query time from ~140ms to single-digit milliseconds.
The takeaway: a slow-ops alert is most useful when you immediately group the entries by query shape. If one shape dominates, the fix is usually a single index or a query rewrite. If the entries are spread across many shapes with no clear leader, the cause is more likely systemic, namely cache pressure, lock contention, or an under-provisioned member, and you escalate to the capacity and WiredTiger cards rather than chasing individual queries.

Sibling cards

Reconciling against the source

Where to look in MongoDB’s own tooling:
db.system.profile.find({ millis: { $gt: 100 } }).sort({ ts: -1 }) in mongosh against a profiled database returns the raw slow-operation entries this card counts, with the query shape, duration, plan summary, and timestamp. db.getProfilingStatus() confirms the profiling level and the slowms value in effect, so you can verify the threshold the card is counting against. The mongod log also records slow operations (lines tagged Slow query) independently of the profiler, controlled by the same slowms; this is a useful cross-check if profiling is off but logging is on. db.currentOp({ "secs_running": { $gte: 1 } }) shows operations that are slow right now and still running, which the profiler only records once they finish.
On MongoDB Atlas, the Performance Advisor and the Profiler tab surface slow queries with the same slowms basis, and the Query Profiler view groups them by shape, which is the managed equivalent of the Top 10 Slow Operations card. Why our number may legitimately differ from the profiler: Cross-connector reconciliation: a slow-ops spike during a checkout or campaign window is a high-value pattern. Pair with Slow Ops During Checkout Window (5m) and the ecommerce order-rate cards to confirm whether the slow operations are hitting the revenue path or a background workload.

Known limitations / FAQs

The card reads zero but I know my queries are slow. Why? The most likely reason is that profiling is disabled (level 0) on the database in question. Profiling is set per database, not cluster-wide, so a newly created database inherits the default and may not be profiled. Check with db.getProfilingStatus() and enable level 1 with db.setProfilingLevel(1) to capture operations over slowms. The mongod log records slow queries independently, so cross-check there too. Does enabling the profiler slow my database down? Profiling at level 1 has negligible overhead because it only writes a document for operations that were already slow; the cost is one small insert per slow op into a capped collection. Level 2 (log everything) does add measurable overhead on a busy database because it writes a document for every operation, so it is a diagnostic setting, not a production one. This card works with level 1, the recommended production setting. My slowms is set to 50ms, not 100ms. Does the card still make sense? Yes, the card counts against whatever slowms the deployment actually uses; the 100ms in the title is the MongoDB default. A lower slowms will produce a higher count because it captures operations between 50ms and 100ms that the default would ignore. If you want the count to mean the same thing across deployments, standardise slowms and adjust the alert threshold accordingly. Many different query shapes are slow, not just one. What does that mean? A single dominant shape usually points at one missing index or a bad query, an easy fix. A count spread across many unrelated shapes points at a systemic cause: cache pressure (the working set no longer fits, so everything reads from disk), lock contention, replication lag stealing resources from a secondary, or an under-provisioned member. Escalate to WiredTiger Cache Hit Rate %, Connections In Use, and the capacity cards rather than chasing individual queries. The count keeps climbing and now I am seeing errors. Are they the same problem? Usually yes, in sequence. A query that is slow can become a query that times out as load increases or the working set grows; the slow op converts to an error. This is why Query Error Rate % often follows a slow-ops spike with a lag. Fix the slow operations (index, rewrite, or capacity) and the errors typically resolve with them. Can I change the alert threshold of 10? Yes. Ten slow ops per 15 minutes is the generic default. Alert thresholds are configurable per profile in the Alert Rules tab. A small, lightly loaded cluster may want a lower threshold so it catches degradation earlier; a large, high-throughput cluster that always carries some slow tail may want a higher one so the alert reflects a genuine change rather than its normal baseline.

Tracked live in Vortex IQ Nerve Centre

Slow Ops (15m, >100ms) is one of hundreds of KPI pulses Vortex IQ tracks across MongoDB and 70+ other ecommerce connectors. Nerve Centre runs the detection layer; Vortex Mind investigates the cause when something moves; Ask Viq lets you interrogate any number in plain English. Start for free or book a demo to see this metric running on your own data.