defaultMaxTimeMS cluster-level read timeout
Parent: Operation rejection filters · Published reference · snapshot 2026-10-31
↓ Facts as markdownall context files
Source-anchored research for defaultMaxTimeMS cluster-level read timeout. 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.
How it works
- The MongoDB server implementation README says defaultMaxTimeMS takes effect only when authentication is enabled. (low confidence) (verified as of 2026-10-30) [source]
- Because the implementation README assigns defaultMaxTimeMS the same semantics as maxTimeMS, interpret it as a server processing-time budget: termination occurs at designated interrupt points, client-to-server network latency is excluded, and mongos-to-mongod latency is included. (medium confidence) [source]
How-to and procedures
- Configure a five-second default on the admin database with db.adminCommand({setClusterParameter:{defaultMaxTimeMS:{readOperations:5000}}}); inspect it with db.adminCommand({getClusterParameter:"defaultMaxTimeMS"}). (low confidence) [source]
Problems, failure modes and limitations
- MongoDB 8.0 introduced defaultMaxTimeMS.readOperations as a cluster-wide fallback time limit in milliseconds for individual read operations that omit maxTimeMS. (high confidence) [source]
- defaultMaxTimeMS.readOperations defaults to 0, which supplies no default query timeout. It is not automatically a finite execution limit merely because the deployment uses MongoDB 8.0. (high confidence) [source]
Comparisons and alternatives
- Atlas describes this timeout as a last-round mitigation that cancels overlong operations and limits resource retention; Tencent likewise identifies resource exhaustion prevention as its purpose. This is execution-time protection rather than a prediction that a query will be expensive. (medium confidence) [source]
- The implementation README says users with bypassDefaultMaxTimeMS ignore the default, and root and __system have that privilege by default. Verify enforcement with the application identity rather than only an administrative identity. (low confidence) (verified as of 2026-10-30) [source]
- MongoDB Atlas documents defaultMaxTimeMS as mitigation for expensive queries, including collection scans from missing indexes; database teams can set the fallback centrally rather than rely on every application to set a timeout. Mydbops independently describes the same operational use. (medium confidence) [source]
Facts and statements
- Supported reads are find, count, distinct, dbHash, and aggregate without $out or $merge. Aggregations containing either write stage do not inherit this default, although an explicit maxTimeMS can still apply. (high confidence) [source]
- An explicit operation-level maxTimeMS overrides the cluster default, including a longer timeout for legitimate analytics work; the setting therefore is not a mandatory upper bound on every read. (high confidence) [source]
- The MongoDB server implementation README says defaultMaxTimeMS has an effect only with authentication enabled. Users granted bypassDefaultMaxTimeMS ignore the default; root and __system include that privilege by default. (low confidence) (verified as of 2026-10-30) [source]
- DRIVERS-3474 reports that timeoutMS=0 in a mongosh URI does not override defaultMaxTimeMS, whereas explicit maxTimeMS(0) does. Its July 22, 2026 update describes the Node.js driver's infinite client timeout as not emitting a server maxTimeMS override and leaves the spec change unresolved. (low confidence) (verified as of 2026-07-22) [source]
- Crossplane's provider-mongodbatlas v1.6.0 API, published October 22, 2026, exposes optional DefaultMaxTimeMs with JSON name defaultMaxTimeMs and Terraform name default_max_time_ms, showing a declarative configuration surface for the setting. (low confidence) (verified as of 2026-10-22) [source]
- The implementation README says commands exceeding defaultMaxTimeMS return MaxTimeMSExpired. This is an execution timeout, not a guarantee that the operation is rejected before execution begins. (low confidence) [source]
Children
- bypassDefaultMaxTimeMS privilege (frontier)
- MaxTimeMSExpired and interrupt-point termination (frontier)
- Operation-level maxTimeMS precedence (frontier)
Frontier under this node: MaxTimeMSExpired and interrupt-point termination, Operation-level maxTimeMS precedence, bypassDefaultMaxTimeMS privilege