Hi @Pandhu Wibowo
In Azure Cosmos DB for MongoDB API, the maxTransactionLockRequestTimeoutMillis setting is fixed at 5 seconds for multi-document transactions. This timeout is not configurable, and there is currently no method to extend it to 30 seconds or any other value.
While we cannot modify the lock acquisition timeout, you can mitigate the impact of this limitation by:Optimizing Transaction Scope:
Limit the number of documents involved in a transaction to reduce lock contention.
Copy
Ensure that the operations within the transaction are as efficient as possible.
Implementing Retry Logic:
- Incorporate retry mechanisms in your application to handle transient failures due to lock timeouts.
- Use exponential backoff strategies to avoid overwhelming the system with retries.
Monitoring and Scaling:
- Monitor your Cosmos DB account's throughput and adjust the Request Units (RUs) as needed to handle higher loads.
- Consider scaling your Cosmos DB resources to accommodate more intensive workloads. Please refer the below doc https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/limits
I hope this information helps. Please do let us know if you have any further queries.
If the comment is helpful, please click "Upvote it".