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.

질문됨 2달 전164회 조회
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
답변함 2달 전
profile picture
전문가
A_J
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠