Document DB Read timeout

0

I have a Document DB cluster (t3.medium) with cpu utilisation of 20% 2 read replica and one primary cluster in two aws accounts. Whenever I run a query every seventh time the query gives timeout. I understand Transactions have a one minute execution limit and sessions have a 30-minute timeout. If a transaction times out, it will be aborted, and any subsequent commands issued within the session for the existing transaction will yield the error. This query runs fine in one account(aws A) but times out in another account(aws B) within 1 min. The total storage in B is 1.30 GB and in A its 0.1 GB. As t3 should offer 4GB , what else could cause timeout ? Is there a way to resolve timeout.

已提问 4 个月前210 查看次数
1 回答
0

The issue described by you generally occurs when a Query hits defined timeout.

In AWS DocumentDB transactions have a one minute execution limit and sessions have a 30-minute timeout. If a transaction times out, it will be aborted, and any subsequent commands issued within the session for the existing transaction will yield the following error:

WriteCommandError({ "ok" : 0, "operationTime" : Timestamp(1603491424, 627726), "code" : 251, "errmsg" : "Given transaction number 0 does not match any in-progress transactions." })

It is mentioned in the document below-

[+] https://docs.aws.amazon.com/documentdb/latest/developerguide/transactions.html

This is also possible if your application has a timeout mechanism.

As you are aware, any individual query that takes more than the timeout value will be killed. This means, an operation (query, aggregation, crud) must complete within the timeout limit.

As a workaround, you can run your query in batches to reduce each batch overall execution time.

Additionally, I would like to provide solutions for common diagnostics issues in Amazon DocumentDB deployments, especially about performance-

[1] Performance and Resource Utilization - How Do I List All Running Operations on an Instance? - https://docs.aws.amazon.com/documentdb/latest/developerguide/user_diagnostics.html#user_diagnostics-list_queries [2] Performance and Resource Utilization - How Can I See a Query Plan and Optimize a Query? - https://docs.aws.amazon.com/documentdb/latest/developerguide/user_diagnostics.html#user_diagnostics-query_plan [3] Profiling Amazon DocumentDB Operations - https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html

Lastly, I would advise you to reach out to the DocDB Support Teams along with the error and the timestamp when you observed this issue. They would be able to provide you with a descriptive performance analysis of the DB instance in terms of DB instance class configuration which could help determine the exact cause and possible solutions.

AWS
支持工程师
Ruchi_P
已回答 4 个月前
profile picture
专家
已审核 4 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则