2

I have a table in DynamoDB that has a provisioned capacity unit for both read and write of 2. Auto-scaling is not enabled and my queries are eventually consistent. I can sit and loop over an API call 1,000 times using Postman with each call returning 1,500 items in each API call with a total query size of 268KB. DynamoDB tells me it consumes 45 capacity units in the query.

When I look in X-Ray over a 5 minute period I can average 86 DynamoDB queries per minute at 294ms per query on average. I am confused on why I am able to make this many requests, for the number of records and size of the records queried at just 2 RCU. This test of mine ran for about 10 minutes before it was finished and I've run it multiple times.

This is the metrics from X-Ray showing the number of queries per minute happening and the milliseconds to run the query.

enter image description here

I can look at the DynamoDB metrics and see that I do have 2 RCU provisioned and that my Read Capacity consumed is way beyond that. I do see throttled events happening but no where near the number that I would expect for the queries per minute happening at 268 KB each for the 2 RCU I have provisioned.

enter image description here

Can someone help me understand why I am not seeing more aggressive throttling or decreased query performance? I did read through this post where it mentioned DynamoDB will store up to 5 minutes of capacity for you to burst with. At 2 RCU I would assume I'd deplete that 5 minute worth in the first few queries. My test ran for about 10 minutes.

Johnathon Sullinger
  • 7,097
  • 5
  • 37
  • 102
  • This might be due to using [burst capacity](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html#bp-partition-key-throughput-bursting) that allows you to use up to 5 minutes of unused capacity. However, it might be used-up more quickly than 5 minutes. Or, take a look at [DynamoDB on-demand pricing](https://aws.amazon.com/blogs/aws/amazon-dynamodb-on-demand-no-capacity-planning-and-pay-per-request-pricing/), which might be more or less expensive depending on your usage. – John Rotenstein Jul 22 '20 at 00:13

0 Answers0