Why it matters
On-demand mode is convenient for new or spiky streams, but streams with steady traffic often stay on it long after their traffic pattern is known.How nOps finds it
nOps reads the last 30 complete days of Kinesis billing. A stream is flagged when it was billed in at least 90% of the 720 hours and has at least 30 days of history. The shard count covers twice the busiest hour’s average ingest rate (or 1.5 times its read rate). Provisioned cost is those shards plus PUT payload units at list price, adjusted to the rate you are billed today. The saving is the last 7 days of on-demand cost, scaled to a month, minus that provisioned cost. Streams created by RDS Database Activity Streams and savings under $25 a month are left out.Before you start
Permission to change the stream mode (kinesis:UpdateStreamMode) and a CloudWatch alarm on throttling.
How to implement
- Note the shard count shown in the recommendation and check the stream’s recent peak in CloudWatch (
IncomingBytes,IncomingRecords). - In the Kinesis console, open the stream and choose Configuration → Edit capacity mode → Provisioned, or run
aws kinesis update-stream-mode --stream-arn ARN --stream-mode-details StreamMode=PROVISIONED. - Set the shard count with
aws kinesis update-shard-countif it differs from what Kinesis picks. - Add CloudWatch alarms on
WriteProvisionedThroughputExceededandReadProvisionedThroughputExceeded, or set up shard scaling. - Update the stream mode in Terraform or CloudFormation.
Risks and considerations
- A provisioned stream throttles writes above its shard capacity, so a traffic spike larger than the headroom can fail or slow producers.
- The capacity mode can be switched only a limited number of times a day.
- To roll back, switch the stream back to on-demand mode.
FAQs
How does nOps pick the number of shards?
How does nOps pick the number of shards?
It takes the busiest hour of the last 30 days and allows twice that ingest rate (or 1.5 times the read rate), whichever needs more shards.