- Newest
- Most votes
- Most comments
Follow as mentioned above in the comment.
Note:
Query Execution Time (Time taken by the database server to actually process and execute the query) vs. Total Operation Time (Overall time from when a client initiates a query request to when it receives the complete results.): The maxTime parameter sets a time limit for the actual execution time of the query on the server. However, there are other operations involved in the complete process, such as Network latency, Query planning and optimization or Result serialization and transmission
Granularity of Checks: DocumentDB doesn't check the elapsed time continuously. Instead, it performs periodic checks during query execution. This means that the actual termination might occur slightly after the specified time.
Server-side vs. Client-side Timing: The maxTime is enforced on the server-side. The time you observe on the client-side includes additional overheads.
System Load and Resources: The exact timing of the termination can be influenced by the current system load, available resources, and other concurrent operations.
Clock Synchronization: There might be slight differences in clock synchronization between the client and the server.
Implementation Details: The exact implementation of the maxTime feature in DocumentDB might introduce some additional overhead or delay.
The additional 6 seconds over the specified 5 seconds could be due to a combination of the factors mentioned above, primarily the granularity of time checks and the total operation time vs. query execution time.
maxTime is a useful feature for preventing runaway queries, Its primary purpose is to prevent queries from running for excessively long periods, not to enforce exact execution times.
answered 2 years ago
The maxTimeMS function in DocumentDB sets a time limit for an operation but doesn't guarantee termination exactly at that limit.
The check for timeout happens only at certain points during execution, not continuously.
Network latency or other overheads can also cause delays.
AWS DocumentDB queries have a default timeout of 2 hours and as of a certain date, they didn't support the maxTimeMS setting.
If delays persist, consider scaling up your DocumentDB instance.
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 10 months ago
