最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can the DynamoDB GetLatency higher than Query? - Stack Overflow

programmeradmin2浏览0评论

Theoretically the getItem latency in dynamodb should be lower than query in dynamodb. but I am getting higher latency for get. Partition is not very large just 5-6 items of small size.

Query Latency : Max Avg is around 48

Get Latency: Max Avg is around 61

I understand average may not be the best parameter to judge, but I have also seen the maximum values for GetItem higher than Query.

Theoretically the getItem latency in dynamodb should be lower than query in dynamodb. but I am getting higher latency for get. Partition is not very large just 5-6 items of small size.

Query Latency : Max Avg is around 48

Get Latency: Max Avg is around 61

I understand average may not be the best parameter to judge, but I have also seen the maximum values for GetItem higher than Query.

Share Improve this question asked Mar 17 at 14:11 Ankit AabadAnkit Aabad 1552 silver badges5 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

Checking latency of DynamoDB when you only make a couple of requests is not going to give you obvious latency variance.

In reality Query and GetItem will have similar performance when Query is only returning a small number of items, as Query will only read a contiguous block on disk.

Latency in a large distributed system such as DynamoDB can vary by a couple of milliseconds here or there. A more accurate test would be to run a load test for a duration of 5 minutes using each method.

It could be due to many things, hard to tell, specially without knowing the access pattern and without seeing the entire code. I'd start with these:

  1. Check if you are passing the same values of ConsistentRead to both Get and Query, that's one parameter that can impact latency.

  2. Compare the size of the response payloads for GetItem and Query. A larger payload (item size) could be making GetItem slower

  3. Any network overhead you might be having while using GetItem?

  4. Are you reading from the same table, same region?

  5. The number of GetItem vs Query calls seems to be low to make the assumption that one has lower latency than the other. Do you have a way to run a load test?

发布评论

评论列表(0)

  1. 暂无评论