Sustained overload / soak testing (memory leaks, connection pool exhaustion, WiredTiger cache thrashing, ticket starvation, oplog window shrinkage)
Parent: MongoDB Stress, Soak, and Chaos-Resilience Testing · Published reference · snapshot 2026-10-24 · skill mongodb-cohort-22db29b88ceb
↓ Facts as markdownall context files
Source-anchored research for Sustained overload / soak testing (memory leaks, connection pool exhaustion, WiredTiger cache thrashing, ticket starvation, oplog window shrinkage). Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Definitions
- The oplog window is the difference between its newest and oldest timestamps. A disconnected secondary needs its missing history retained to resume replication; soak-test acceptance should compare the observed retention interval with the intended interruption and catch-up budget. The acceptance rule is an inference from the documented replication requirement. (medium confidence) [source]
- Mongoose issue #15785 is an unconfirmed leak allegation, not proof of a database leak. In November 2025 the reporter associated connection logs with RAM spikes, but a maintainer challenged the attribution and requested clarification; the reporter acknowledged that more investigation was needed. (low confidence) [source]
How it works
- High host memory use alone does not prove a MongoDB memory leak: WiredTiger has an internal cache, the operating system caches files, and other operations consume RAM. Alibaba also documents heap fragmentation as a cause of increasing memory use. In a soak test, separate these categories before interpreting a rising total as leaked allocations. (high confidence) [source]
- Tickets govern storage-engine concurrency and are distinct from client connections. Secondary oplog replay also consumes write tickets; prolonged exhaustion can increase replication lag. Saturated CPU, disk or cache may become worse when ticket limits rise. Alibaba recommends fixing those underlying constraints first. (low confidence) [source]
- Node.js driver documentation identifies a version-specific idle-connection defect: before 6.18.0, idle connections were not closed during inactivity when minPoolSize was zero; 6.18.0 corrected this behavior. Include an idle period after load when checking connection reclamation on affected driver versions. (low confidence) [source]
- For an oplog constrained by size, increased oplog generation can reduce the retained time window. A disconnected secondary needs its required history to remain available to resume replication. A soak-test recommendation inferred from this mechanism is to compare replication lag and planned interruption duration against the measured window throughout the run. (low confidence) [source]
How-to and procedures
- To investigate cache thrashing, correlate repeated cache reads and dirty-page evictions with storage traffic, checkpoint duration and latency. Cache reads can be served by the OS filesystem cache, so WiredTiger cache traffic alone does not establish physical disk saturation. (high confidence) [source]
Measurements and reference values
- An experiment using MongoDB 5.0.2 found that retryable findAndModify operations could churn a roughly 990 MB oplog while updating a 5 MB document 300 times. The article also describes moving images to a side collection and says that behavior became the default in 5.1. Treat this as a version-scoped regression workload, not a general claim about current releases. (low confidence) (verified as of 2026-07-11) [source]
Problems, failure modes and limitations
- Driver pool exhaustion is observable before a server connection-limit failure: when no idle connection exists and maxPoolSize or maxConnecting prevents creation, checkout requests wait. Soak-test instrumentation should measure checkout duration, checked-out connections and checkout failures; the pooling specification defines events for these transitions. (low confidence) [source]
- Minimum oplog retention can preserve more history under fluctuating writes, but it can increase disk consumption. A test that enables a retention floor must also observe free disk space; retention time and fixed storage capacity cannot both be assumed constant. (medium confidence) [source]
- Do not treat the WiredTiger cache limit as a cap on total mongod or host memory, or automatically enlarge it after a soak failure. MongoDB reserves memory uses outside that cache and advises against increasing it above its default; Alibaba documents additional allocator-related memory pressure. (high confidence) [source]
- In the Node.js driver, each MongoClient has a pool per topology server. When in-use connections reach maxPoolSize, subsequent requests wait. waitQueueTimeoutMS bounds socket-checkout waiting; an expired wait raises a connection error. Soak validation should record checkout delay and failures alongside operation latency. (low confidence) [source]
- The Node.js driver does not limit the number of requests waiting for sockets. A bounded connection count therefore does not itself bound application backlog. Reuse a MongoClient per process and control application concurrency when testing sustained demand. (low confidence) [source]
Comparisons and alternatives
- For MongoDB 7.0 and later, dynamically allocated read/write tickets make a low available-ticket count insufficient evidence of overload. The WiredTiger manual recommends queued read/write tickets as the overload indicator. Record queue persistence and latency rather than imposing an invariant of 128 available tickets. (high confidence) (verified as of 2026-10-24) [source]
- The oplog window is the elapsed time between its oldest and newest timestamps. Heavy write workloads can consume history without increasing database size: multi-document updates, in-place updates, and balanced inserts/deletes are documented examples. Track history duration during sustained writes rather than using database growth as a proxy. (high confidence) [source]
- Minimum oplog retention changes the storage tradeoff: MongoDB removes an entry only after the oplog reaches its configured size and the entry exceeds the configured age. Do not assume the configured size is a hard storage ceiling; monitor disk headroom when testing high write rates with time-based retention. (low confidence) [source]
Facts and statements
- An instrumentation inventory for a MongoDB soak test can combine WiredTiger cache usage, activity and eviction, open cursors and sessions, queued operations, checkpoint time and host memory with driver connection-checkout waits and oplog-window retention. The cited sources describe these individual measures; they do not prescribe a universal soak duration or pass threshold. (medium confidence) [source]
- Include a bounded long-running-transaction case in a soak test: uncommitted work can pressure the WiredTiger cache, and expired or abandoned transactions need cleanup. MongoDB documents transaction aborts under excessive cache pressure; Alibaba warns that increasing transaction lifetime can worsen latency and service availability. (high confidence) [source]
- A November 22, 2025 Mongoose issue reports growing connection counts and RAM alongside unauthenticated-connection messages with Mongoose 9.0.0, Node.js 22.17.1 and MongoDB 8.0.16. It is a reproduction lead, not proof of a confirmed driver leak: the page is closed with stale and needs-clarification labels. (low confidence) (verified as of 2026-10-24) [source]
- For sustained cache-pressure diagnosis, correlate cache occupancy, dirty-page eviction, checkpoint duration, disk I/O and query latency. Percona documents these panels together; Alibaba recommends continuous observation of cache eviction, disk utilization, latency and replication lag during concurrency changes. This combination is an inferred soak-test measurement set. (high confidence) [source]
- A high rate of reads into WiredTiger cache does not prove equivalent physical disk reads: the operating-system filesystem cache can serve those reads. A soak test should compare cache activity with storage metrics before attributing latency to disk-backed cache thrashing. (low confidence) [source]
Children
- No children recorded.