maxTimeMS (Server-side Operation Timeout)
Parent: Client Side Operations Timeout (CSOT) · Published reference · snapshot 2026-10-15 · viability 3.85 / 5 (research)
↓ Facts as markdownall context files
Depth-first rabbithole dossier for maxTimeMS (Server-side Operation Timeout); source-anchored research pack.
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.
Problems, failure modes and limitations
- [high] maxTimeMS specifies a cumulative time limit in milliseconds for processing operations on a cursor. (In Azure DocumentDB, the default query execution limit is 120 seconds, overridable per query with maxTimeMS.) Sources: https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS.md, https://learn.microsoft.com/en-us/azure/documentdb/limitations [source]
- [low] Starting in MongoDB 8.0, the defaultMaxTimeMS cluster parameter specifies a default time limit for individual read operations, which is overridden if a query specifies a maxTimeMS option. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS.md [source]
- [low] MongoDB only terminates an operation at designated interrupt points, and queries generating multiple batches continue to return results until the cursor exceeds its allotted time limit. Sources: https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS.md [source]
- [low] MongoDB does not count network latency between the client and the server towards a cursor's time limit, but in sharded clusters, it includes the latency between mongos and mongod. Sources: https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS.md [source]
- [low] If a delay exceeding maxTimeMS is encountered before query execution, the query is allowed to execute to completion and may generate a slow-query log. Sources: https://jira.mongodb.org/browse/SERVER-100786 [source]
Facts and statements
- [low] In sharded clusters, the router detects the timeout and cancels the operation, but the mongod continues to execute the query past the timeout. Sources: https://jira.mongodb.org/browse/SERVER-100786 [source]
- [low] If a session is idle for longer than 30 minutes, the MongoDB server marks it as expired and may close it, killing any in-progress operations and open cursors associated with the session. Sources: https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS.md [source]
- [low] The maxTimeMS option can be applied to a query using the syntax db.collection.find({ field: "value" }).maxTimeMS(5000). Sources: https://learn.microsoft.com/en-us/azure/documentdb/limitations [source]
- [low] A bug affecting maxTimeMS behavior in versions 7.0.0, 8.1.0-rc0, and 8.0.0 was fixed in version 8.2.0-rc0. (verified as of 2026-10-15) Sources: https://jira.mongodb.org/browse/SERVER-100786 [source]
Related concepts
- maxTimeMS — is a part of maxTimeMS (Server-side Operation Timeout)
- Operation — is a part of maxTimeMS (Server-side Operation Timeout)
- Timeout — is a part of maxTimeMS (Server-side Operation Timeout)
Children
- No children recorded.