MongoDB globalLock.currentQueue growing: operations queuing for the storage engine
globalLock.currentQueue.total is climbing and not stabilizing after a burst. Under WiredTiger, this metric reflects waits at the intent lock and ticket admission layers, not a single global mutex. The engine is receiving work faster than it can drain it.
If the total queue sustains above 20 and grows, the system is saturated. Queued operations become latency spikes, then connection pileups as applications retry, then a degradation spiral. The root cause is usually ticket exhaustion, a single hot collection, a long-running operation, or storage I/O degradation inflating ticket hold times.
What this means
db.serverStatus().globalLock.currentQueue returns { total, readers, writers }. Non-zero values mean operations are waiting. A small, stable queue under load is normal. A queue that grows without bound means the server cannot acquire the locks or tickets needed to execute work.
Under WiredTiger, globalLock reflects aggregate waits at the collection, document, and storage-engine ticket layers. When writers dominates and readers stays near zero, the bottleneck is typically a single write-heavy collection. When both grow together, the storage engine is saturated.
Common causes
| Cause | What it looks like | First thing to check |
|---|---|---|
| Ticket exhaustion (systemic saturation) | currentQueue grows for both readers and writers; wiredTiger.concurrentTransactions shows available tickets below 25% of total (pre-7.0), or queues.execution queue length is rising (8.0+); latency increases across all namespaces | Ticket availability or admission queue length |
| Single hot collection | writers is high and readers is near zero; one collection appears repeatedly in currentOp or the slow query log; locks stats show Collection wait time growing | db.currentOp() filtered by secs_running and ns |
| Long-running operation blocking the queue | A single op holds tickets or locks for minutes; queue builds behind it; currentOp shows an aggregation, collection scan, or uncommitted transaction | db.currentOp({ "active": true, "secs_running": { "$gt": 10 } }) |
| Slow disk I/O (checkpoint or journal stall) | Queue grows alongside a high cache dirty ratio, checkpoint duration climbing, or journal sync latency spiking; operations hold tickets longer because they wait on disk | db.serverStatus().wiredTiger.transaction checkpoint times and wiredTiger.log sync duration |
| DDL during production traffic | Sudden queue spike during an index build, collMod, or chunk migration; locks stats show Metadata or Global acquisition waits increasing | db.serverStatus().locks and db.currentOp({ "waitingForLock": true }) |
Quick checks
# Check queue depth and composition
mongosh --quiet --eval 'db.serverStatus().globalLock.currentQueue'
# Check available tickets on MongoDB 6.x and earlier
mongosh --quiet --eval 'db.serverStatus().wiredTiger.concurrentTransactions'
# Check admission queue length on MongoDB 8.0+
mongosh --quiet --eval 'db.serverStatus().queues.execution'
# Find long-running operations
mongosh --quiet --eval 'db.currentOp({ "active": true, "secs_running": { "$gt": 10 } }).inprog.forEach(o => print(o.opid, o.op, o.secs_running, o.ns))'
# Find operations waiting for locks
mongosh --quiet --eval 'db.currentOp({ "waitingForLock": true }).inprog.forEach(o => print(o.opid, o.op, o.ns))'
# Check lock wait times by type
mongosh --quiet --eval 'var locks = db.serverStatus().locks; for (var type in locks) { var l = locks[type]; if (l.acquireWaitCount) { for (var mode in l.acquireWaitCount) { print(type, mode, "waits:", l.acquireWaitCount[mode], "us:", l.timeAcquiringMicros[mode]); } } }'
# Check checkpoint duration and raw journal sync counters
mongosh --quiet --eval 'var t=db.serverStatus().wiredTiger.transaction; print("checkpoint ms:", t["transaction checkpoint most recent time (msecs)"]); var l=db.serverStatus().wiredTiger.log; print("sync us:", l["log sync time duration (usecs)"], "ops:", l["log sync operations"])'
# Check cache dirty ratio
mongosh --quiet --eval 'var c=db.serverStatus().wiredTiger.cache; var max=c["maximum bytes configured"]; print("dirty %:", (100*c["tracked dirty bytes in the cache"]/max).toFixed(1))'
How to diagnose it
Confirm the queue is growing, not spiking. Sample
globalLock.currentQueueat 10-second intervals. A burst to 50 that drops to 0 is normal. Sustained >20 over minutes is saturation.Determine the composition. Writers-only suggests a collection hotspot or DDL. Mixed growth suggests systemic storage saturation.
Correlate with tickets (version-aware). On MongoDB 6.x and earlier, if
wiredTiger.concurrentTransactions.write.availableis near zero while the queue grows, tickets are exhausted. On MongoDB 7.0+, dynamic adjustment meansavailablemay be zero by design; focus on whether the queue persists. On MongoDB 8.0+, inspectqueues.executionfor explicit queue-length growth.Inspect current operations. Use
db.currentOp()to find operations running longer than 60 seconds or waiting for locks. Note the namespace and operation type. A single long-running aggregation or uncommitted transaction can pin resources and back up the queue.Check storage health. Review WiredTiger checkpoint duration, journal sync latency, and cache dirty ratio. If the dirty ratio is above 10% and checkpoint duration is climbing toward 30 seconds, slow I/O is causing operations to hold tickets longer.
Review lock stats and slow queries. Growing
timeAcquiringMicrosunderCollectionorMetadataconfirms lock contention. Slow query log entries withCOLLSCANor highkeysExaminedtodocsReturnedratios reveal queries consuming tickets without making progress.
Metrics and signals to monitor
| Signal | Why it matters | Warning sign |
|---|---|---|
globalLock.currentQueue.total | Direct measure of operations waiting for admission | Sustained >20 with an upward trend |
globalLock.currentQueue.writers vs readers | Writers-only indicates a collection-level hotspot, not system-wide saturation | writers » readers for more than 2 minutes |
wiredTiger.concurrentTransactions (<=7.x) | Ticket exhaustion blocks new operations from entering the storage engine | Available tickets below 25% of total sustained |
queues.execution (8.0+) | Canonical admission-control stats with explicit queue length | Queue length growing while processing rate stays flat |
| WiredTiger cache dirty ratio | Rising dirty data means checkpoints take longer and writes hold tickets longer | Sustained dirty ratio above 10% |
| Checkpoint duration | Long checkpoints back up journal writes and extend ticket hold times | Sustained duration above 30 seconds |
| Journal sync latency | Slow disk I/O is the most common root cause of ticket hold-time inflation | Average sync latency above 30 ms |
db.currentOp() max age | A single runaway operation can hold tickets and block the queue | Any non-background operation above 300 seconds |
| Lock wait times | Quantifies time lost to contention at the collection or metadata layer | timeAcquiringMicros increasing for Collection or Metadata |
Fixes
Kill or throttle the offending operation
If db.currentOp() shows a runaway query, aggregation, or abandoned multi-document transaction, terminate it with db.killOp(opid) to release tickets and locks. Warning: killing a write operation may leave data partially updated if it is not idempotent. Aborting a transaction is safer but requires application retry logic.
Reduce write throughput
If a bulk import, migration, or batch job is driving the queue, pause or throttle it. This is often the fastest way to drain a saturated ticket pool and prevent cache pressure from compounding.
Address storage I/O degradation
If journal sync latency or checkpoint duration is elevated, inspect the underlying disk. On cloud VMs, burst-credit depletion is a common cause. If the primary is affected, stepping down to a secondary on healthier storage can restore throughput. Warning: stepping down triggers an election and brief write unavailability.
Reschedule DDL operations
If the queue correlates with an index build, collMod, or chunk migration, move the operation to a maintenance window. Foreground DDL holds locks that serialize production traffic.
Prevention
- Monitor
globalLock.currentQueueas a trend. Alert on sustained growth rather than transient spikes. - Track ticket utilization (or
queues.executionon 8.0+) alongside queue depth to see admission pressure before it becomes latency. - Keep the slow query log enabled and review it weekly. Collection scans and missing indexes are common precursors to queue events.
- Maintain storage headroom. Cloud disks with burst-credit models need usage buffers; on-prem disks need RAID health monitoring to avoid I/O degradation that inflates ticket hold times.
How Netdata helps
- Auto-collects
globalLock.currentQueue,wiredTiger.concurrentTransactions, andqueues.execution(8.0+). - Correlates queue depth with cache dirty ratio, checkpoint duration, and journal sync latency.
- Surfaces long-running operations via
db.currentOp()metrics. - Per-second resolution catches trends that minute-level sampling misses.
Related guides
- How MongoDB actually works in production: a mental model for operators: /guides/mongodb/how-mongodb-works-in-production/
- MongoDB pages evicted by application threads: when eviction becomes user latency: /guides/mongodb/mongodb-application-thread-evictions/
- MongoDB WiredTiger cache dirty ratio high: the leading indicator nobody watches: /guides/mongodb/mongodb-cache-dirty-ratio-high/
- MongoDB WiredTiger cache pressure cascade: eviction stalls and latency spikes: /guides/mongodb/mongodb-cache-pressure-cascade/
- MongoDB cache too small: sizing the WiredTiger cache for your working set: /guides/mongodb/mongodb-cache-undersized-working-set/
- MongoDB checkpoint duration climbing: diagnosing slow WiredTiger checkpoints: /guides/mongodb/mongodb-checkpoint-duration-high/
- MongoDB checkpoint stall write freeze: when all writes stop with no error: /guides/mongodb/mongodb-checkpoint-stall-write-freeze/
- MongoDB connection refused at maxIncomingConnections: hitting the connection ceiling: /guides/mongodb/mongodb-connection-limit-reached/
- MongoDB connection storm spiral: reconnection floods after an election or deploy: /guides/mongodb/mongodb-connection-storm-spiral/
- MongoDB flow control throttling writes: when the primary slows itself down: /guides/mongodb/mongodb-flow-control-throttling-writes/
- MongoDB journal sync latency high: the storage signal that warns 60 seconds early: /guides/mongodb/mongodb-journal-sync-latency-high/
- MongoDB monitoring checklist: the signals every production cluster needs: /guides/mongodb/mongodb-monitoring-checklist/







