Kinesis consumers fall behind: `GetRecords.IteratorAgeMilliseconds` keeps rising, and producers see `ProvisionedThroughputExceededException`.
AdvancedTroubleshootingRoute 53, CloudFront, API Gateway and Messaging
Answer
Likely causes → Shards are saturated (1 MB/s or 1,000 records/s in, 2 MB/s out per shard), often because of a hot partition key. Too many consumers share the 5 reads/s per shard limit. Or the consumer is slow (a Lambda batch that keeps failing and retrying blocks the shard).
Diagnose →
aws kinesis describe-stream-summary --stream-name clicks --query 'StreamDescriptionSummary.[StreamModeDetails,OpenShardCount]'
aws cloudwatch get-metric-statistics --namespace AWS/Kinesis --metric-name WriteProvisionedThroughputExceeded \
--dimensions Name=StreamName,Value=clicks --statistics Sum --period 60 \
--start-time $(date -u -d '-1 hour' +%FT%TZ) --end-time $(date -u +%FT%TZ)
aws lambda list-event-source-mappings --function-name clicks-consumer --query 'EventSourceMappings[].[BatchSize,ParallelizationFactor,BisectBatchOnFunctionError]'
Fix →
- Switch to on-demand mode, or reshard:
aws kinesis update-shard-count --stream-name clicks --target-shard-count 8 --scaling-type UNIFORM_SCALING - Use a high-cardinality partition key
- Use enhanced fan-out for multiple consumers
- On the Lambda mapping, set
ParallelizationFactor,BisectBatchOnFunctionError,MaximumRetryAttemptsand an on-failure destination
Prevent → Alarm on iterator age, and turn on shard-level metrics to spot hot shards.
More on Route 53, CloudFront, API Gateway and Messaging
You created a public hosted zone and records for `example.com`, but `dig example.com` returns `NXDOMAIN` or old records.Beginner`InvalidChangeBatch: RRSet of type CNAME with DNS name example.com. is not permitted at apex in zone example.com.`BeginnerThe primary Region is down, but Route 53 failover records still send traffic to it.IntermediateA Route 53 health check reports `Failure: Connection timed out` for an endpoint that works fine from your laptop.IntermediateYou changed an A record an hour ago, but some users still reach the old server, and a newly created name returned `NXDOMAIN` for a while.AdvancedCloudFront returns `403 AccessDenied` (S3 XML) for every object after you switched the S3 origin to Origin Access Control.Intermediate