Handling Throttling with Retries, Backoff and Rate Limiting
This lesson explains how correct retry behaviour turns transient FM call failures into small delays, and how rate limiting stops one client from exhausting shared quotas.
Learning outcomes
After completing this lesson, you will be able to:
- Identify Bedrock quotas and the errors that indicate them.
- Configure exponential backoff with jitter in the AWS SDKs.
- Enforce per-client limits with API Gateway.
Bedrock quotas and errors
Amazon Bedrock enforces per-account, per-Region quotas for on-demand inference, typically as requests per minute (RPM) and tokens per minute (TPM) per model, with separate quotas for cross-Region inference profiles and batch jobs. Quotas are viewed and, where adjustable, raised through Service Quotas. Exceeding them returns ThrottlingException (HTTP 429).
Other errors behave differently. ServiceUnavailableException and InternalServerException are transient and retryable. ModelTimeoutException means generation took too long; ModelNotReadyException means an imported custom model is scaling up from zero, and the SDK retries it automatically. ValidationException, AccessDeniedException and ResourceNotFoundException are caused by the request or configuration and must not be retried unchanged. The following table summarises the behaviour.
| Error | Typical cause | Action |
|---|---|---|
| ThrottlingException | RPM or TPM quota exceeded | Retry with backoff; reduce tokens; raise quota; cross-Region inference |
| ServiceUnavailableException, InternalServerException | Transient service issue | Retry with backoff; fall back if persistent |
| ModelTimeoutException | Long generation | Stream, shorten output, raise client timeout |
| ModelNotReadyException | Imported model scaling from zero | Retry (SDK does automatically); keep warm if latency matters |
| ValidationException | Malformed request, input too long | Fix the request; do not retry |
| AccessDeniedException | Missing permission or blocked by policy | Fix IAM, SCP or model access; do not retry |
The following diagram groups the errors by the action each one needs.

Retry or fix the request?
Exponential backoff with jitter in the AWS SDKs
Exponential backoff waits longer after each failed attempt, for example 1, 2, 4 and 8 seconds, so clients stop hammering an overloaded service. Jitter adds randomness to the wait so many clients that failed at the same moment do not retry at the same moment. AWS SDKs implement both. In Boto3, the standard retry mode retries throttling and transient errors with backoff and jitter up to a maximum number of attempts; the adaptive mode adds client-side rate limiting that slows the client down when it observes throttling.
Timeouts matter as much as retries. The default read timeout of an SDK client may be shorter than a long generation, causing the client to abandon a request that would have succeeded; for long outputs, raise the read timeout or stream the response.
import boto3
from botocore.config import Config
brt = boto3.client(
"bedrock-runtime",
config=Config(
retries={"max_attempts": 6, "mode": "adaptive"}, # backoff with jitter plus client-side rate limiting
connect_timeout=5,
read_timeout=300, # long generations need a longer read timeout
),
)The following diagram shows the two traffic paths that protect interactive users from throttling caused by a batch process.

Rate limiting with API Gateway
When many applications or users share an FM backend, API Gateway enforces limits before requests reach the model. Stage and method throttling set a steady-state rate and burst for the API. Usage plans with API keys give each consuming team its own rate, burst and daily or monthly quota, returning HTTP 429 to the client that exceeds it rather than letting it consume the shared Bedrock quota.
Because FM cost and quota usage depend on tokens rather than requests, a GenAI gateway often adds token-based limits: a Lambda function or container counts tokens per team in DynamoDB or ElastiCache and rejects or queues requests when a team exceeds its token budget. Queues in SQS absorb bursts so that work waits instead of failing.
Sharing one FM backend fairly
Throttling at peak
A summarisation service fails with ThrottlingException during a daily peak. Requests come from an internal batch process and an interactive web application. The company wants to protect the interactive users.
Retrying immediately in a tight loop makes throttling worse. A good design uses adaptive retry mode with backoff in both clients, sends the batch process's requests through an SQS queue with a limited number of workers (or moves it to Bedrock batch inference), applies an API Gateway usage plan per consumer, and adds a cross-Region inference profile to raise available throughput. A quota increase can be requested if sustained demand still exceeds it.
Should a ValidationException be retried with backoff?
Show answer
No. It means the request itself is invalid, so it fails again until the request is fixed. Retry only throttling and transient errors.
Exam Tips
Remember for the exam
- Retry throttling and transient errors with exponential backoff and jitter.
- Never retry ValidationException or AccessDeniedException unchanged.
- Adaptive retry mode adds client-side rate limiting.
- Raise the SDK read timeout or stream for long generations.
- Per-consumer limits: API Gateway usage plans; token budgets: gateway logic.