ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

服务 · Analytics · 基于 SAA-C03

Amazon Kinesis Data Streams

Real-time streams sized in shards: limits, fan-out, and fixing throttling and lag.

本课尚未翻译,暂以英文显示。

你在Solutions Architect Associate中已学过

  • A shard takes 1 MB/s or 1,000 records/s in, and gives 2 MB/s out.
  • Provisioned mode sets the shards. On-demand mode scales them.
  • The partition key decides the shard and the order. A skewed key makes a hot shard.
阅读Solutions Architect Associate课程
Producers (KPL)
Kinesis Data Streams
KCL consumer
Fan-out consumer
Firehoseputshared 2 MB/sown 2 MB/sdeliver
One stream, a shared consumer, a fan-out consumer and Firehose delivery.
  • Write throttled

    Likely cause
    Too much for one shard
    Fix
    More shards, better key, retry with backoff
  • Iterator age rises

    Likely cause
    Consumers too slow
    Fix
    More consumers or shards, fan-out
  • Read throttled

    Likely cause
    Consumers share 2 MB/s
    Fix
    Enhanced fan-out, fewer polls
  • One shard hot

    Likely cause
    Skewed partition key
    Fix
    Key with many values, split shard
Four symptoms and their fixes.

1 / 2

  • Write throttled

    Likely cause
    Too much for one shard
    Fix
    More shards, better key, retry with backoff
  • Iterator age rises

    Likely cause
    Consumers too slow
    Fix
    More consumers or shards, fan-out
  • Read throttled

    Likely cause
    Consumers share 2 MB/s
    Fix
    Enhanced fan-out, fewer polls

2 / 2

  • One shard hot

    Likely cause
    Skewed partition key
    Fix
    Key with many values, split shard
Four symptoms and their fixes.

是什么

In provisioned mode you choose the shard count and can split or merge shards. In on-demand mode a new stream starts at 4 MB/s write and 8 MB/s read, and scales up with traffic to a Region-dependent maximum. A stream can switch between the modes twice in 24 hours. A record can be up to 10 MiB, but each stream starts with a 1 MiB limit. You raise the limit in the stream settings. Large records should be rare, not constant. Retention runs from 24 hours to 365 days, and consumers can replay inside that window.

是什么

Producers use the Kinesis Producer Library (KPL) to batch and aggregate records and to retry. Consumers use the Kinesis Client Library (KCL), which spreads shards over workers, keeps leases in a DynamoDB table and tracks checkpoints. All shared-throughput consumers split 2 MB/s per shard. Enhanced fan-out gives each registered consumer its own 2 MB/s per shard, A stream allows 20 such consumers. On-demand Advantage mode allows 50.

是什么

Two errors matter. A producer that sends too much to one shard gets WriteProvisionedThroughputExceeded. A consumer that reads too often gets ReadProvisionedThroughputExceeded: GetRecords allows five calls per second per shard. The metric to watch is iterator age: when it climbs, consumers fall behind. Add shards, add or speed up consumers, use enhanced fan-out, or raise the parallelization factor of a Lambda consumer.

要记住

  • Per shard: 1 MB/s or 1,000 records/s in, 2 MB/s out, five GetRecords calls per second.
  • On-demand starts at 4 MB/s write. Switch modes at most twice in 24 hours.
  • Retention 24 hours to 365 days. Record: 1 MiB by default, can be raised to 10 MiB.
  • KPL batches on the producer side. KCL shares shards among workers with a DynamoDB lease table.

要记住

  • Enhanced fan-out: 2 MB/s per consumer per shard, 20 consumers (50 in On-demand Advantage).
  • Rising iterator age means consumers are behind.

考试中

  • “WriteProvisionedThroughputExceeded on a few records” points to a hot shard: use a key with more values or add shards.
  • “Iterator age keeps growing” points to slow consumers: add shards or consumers, or use enhanced fan-out.
  • “Several applications read one stream without slowing each other” points to enhanced fan-out.