Why is my on-demand DynamoDB table throttling?

3 minute read
1

My on-demand Amazon DynamoDB table is throttling, and I don't know why.

Resolution

DynamoDB tables that use on-demand capacity mode automatically adapt to your application's traffic volume. However, tables that use the on-demand mode might still throttle. The following reasons can cause your DB table to throttle.

The traffic is more than double the previous peak

If you exceed double your previous traffic's peak within 30 minutes, then you might experience throttling. Before you exceed your previous traffic's peak, it's a best practice to spread your traffic growth over at least 30 minutes. To monitor traffic to the table, use the ConsumedReadCapacityUnits metric in Amazon CloudWatch. For more information, see DynamoDB metrics and dimensions.

For new on-demand tables, you can immediately drive up to 4,000 write request units or 12,000 read request units, or a linear combination of both.

For an existing table that you switched to on-demand capacity mode, the previous peak is one of the following values:

  • Half the previous provisioned throughput for the table
  • The setting for a newly created table with on-demand capacity mode

For more information, see Initial throughput and scaling properties.

The traffic exceeds the maximum for each partition

Each partition on the table can serve up to 3,000 read request units or 1,000 write request units, or a linear combination of both. If the traffic to a partition exceeds this quota, then the partition might throttle.

To resolve this issue, complete the following steps:

  1. Use CloudWatch Contributor Insights for DynamoDB to identify the most frequently accessed and throttled keys in your table.
  2. Randomize the requests to the table so that the requests to the hot partition keys are distributed over time. For more information, see Using write sharding to distribute workloads evenly.

The traffic exceeds your account's quota for each table

For on-demand tables, the table-level read throughput and table-level write throughput quotas apply at the account level. By default, the table throughput has a maximum of 40,000 read requests units and a maximum of 40,000 write requests units. If the traffic to a table exceeds the throughput quotas for each table, then the table might throttle.

To resolve this issue, request an account-level quota increase for the table-level read throughput and write throughput.

The global secondary index of your table is throttled

If your DynamoDB table has a secondary global index that's throttled, then the throttling might create back pressure throttles on the base table. For more information, see How does throttling on my global secondary index affect my Amazon DynamoDB table? and Using global secondary indexes in DynamoDB.

The traffic exceeds the maximum configured throughput

When you exceed the maximum read or write throughput that you set on your on-demand table, your table throttles, and you get a ThrottlingException error message. 

Based on your use case, complete the following actions:

To monitor the maximum throughput that's configured for a table or global secondary index, use the OnDemandMaxReadRequestUnits and OnDemandMaxWriteRequestUnits metrics in the CloudWatch console.

Related information

Burst and adaptive capacity

How do I choose the right primary key for my Amazon DynamoDB table?

Why are the metrics on the DynamoDB console different from the CloudWatch metrics?

Service, account, and table quotas in Amazon DynamoDB

Introducing configurable maximum throughput for Amazon DynamoDB on-demand

AWS OFFICIAL
AWS OFFICIALUpdated 3 months ago