DynamoDB has high latency
Why do I see this?
One or more table operation calls such as GET, PUT, UPDATE, SCAN, or QUERY for one of your DynamoDB tables took more than 0.2 seconds to complete.
What does this mean?
DynamoDB is designed to have single-digit millisecond latency for most atomic operations such as GET and PUT. However, certain non-atomic operations such as QUERY and SCAN can experience higher latencies depending on various factors such as the complexity of the query conditions & filters and the size of the result set. Other causes of high latency in DynamoDB:
- The client is too far away from the DynamoDb endpoint
- There are too many DynamoDB calls per second
- The table index has insufficient write capacity to perform heavy writing on the table
- Consistent requests are causing higher average latency
This event notifies you when one of the DynamoDB operations in the last one hour took more than 0.2 seconds.
How do I fix "DynamoDB has high latency"?
Following are some of the measures you can take to reduce latency in DynamoDB:
- Use Global Secondary Indexes (GSI) to speed up queries on non-key attributes and only define GSIs that are commonly used.
- Use Eventually Consistent Reads rather than Strongly Consistent Reads as the latter ones have a higher average latency.
- Reduce the distance between the client and the DynamoDB endpoints by using global tables.
- Use caching with Amazon DynamoDB Accelerator (DAX) to reduce latency if the traffic is read heavy.
You can also checkout the AWS guide to learn more about troubleshooting high latency on Amazon DynamoDB.