Scaling Up/Down a Stream

After a stream is created successfully, you can scale up or down a stream by adding or reducing partitions to meet capacity change requirements. Streams can be scaled automatically or manually.

Function

Scaling rules
  • When scaling up a stream, ensure that the number of target partitions is greater than the number of the current partitions but is not greater than the total number of the remaining quotas and current partitions.
  • When scaling up a stream, restore the DELETED and EXPIRED partitions to the ACTIVE partitions to make the partitions accessible. If the stream capacity is still insufficient, the system will create new partitions.
  • When scaling down a stream, ensure that the number of target partitions is smaller than the number of current partitions but is not smaller than 1.
  • The partitions that have been scaled down will not be charged or occupy the quota. During the lifecycle configured in the incremental package that is billed in pay-per-use mode, data can be read from but cannot be written to the partitions that are successfully scaled in. After the lifecycle elapses, data cannot be read from or written to the partitions.
  • A maximum of 10 automatic scale-up, 10 manual scale-up, and 1 scale-down operations can be performed for each stream within one hour.
  • The interval between performing automatic scale-up and scale-down must be greater than 1 minute. Automatic scale-down cannot be triggered within 2 minutes after automatic or manual scale-up is performed, and meanwhile automatic scale-up cannot be triggered within 2 minutes after automatic or manual scale-down is performed.

Precautions

  • When uploading data, you need to set PartitionKey based on your specific demands so that DIS can automatically upload data to all partitions according to your requirements.
  • When downloading data, you need to periodically use the descriptStream API to check the partition quantity change so that DIS can download data from all partitions.

Manually Scaling Up/Down a Stream

Use either of the following methods to manually scale up or down a stream:
  • Method 1
    1. On the Stream Management page, click the name of the stream to be scaled.
    2. In the upper right corner of the displayed page, click Scale Up/Down. The Scale Up/Down Stream dialog box is displayed.
    3. Change the number of target partitions and click Yes.
  • Method 2
    1. In the Operation column of the stream to be scaled, click More and choose Scale Up/Down from the drop-down list.
    2. The Scale Up/Down Partition dialog box is displayed.
    3. Change the number of target partitions and click Yes.

Automatically Scaling Up/Down a Stream

  1. On the Stream Management page, click the name of the stream to be scaled.
  2. Click Edit next to Auto-Scaling.
  3. In the displayed Edit Auto-Scaling Parameter dialog box, enable Auto-Scaling.
    Figure 1 Edit Auto-Scaling Parameter
  4. Set the upper and lower thresholds for automatic scaling and click OK.