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.

posta 4 mesi fa210 visualizzazioni
1 Risposta
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
TECNICO DI SUPPORTO
Ruchi_P
con risposta 4 mesi fa
profile picture
ESPERTO
verificato 4 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande