All Products
Search
Document Center

ApsaraMQ for Kafka:Elasticity policies

Last Updated:Mar 11, 2026

Serverless ApsaraMQ for Kafka instances automatically scale to handle traffic fluctuations. Reserved capacity sets the baseline throughput for message production and consumption, while elastic traffic extends this baseline during peak periods. For predictable traffic patterns, scheduled elasticity policies adjust reserved capacity on a defined schedule.

Prerequisites

Before you begin, make sure that you have:

  • A serverless ApsaraMQ for Kafka instance in the Running state

How elasticity works

Each ApsaraMQ for Kafka cluster runs three replicas by default. Reserved capacity is distributed evenly across these replicas.

Standard Edition and Professional Edition instances automatically burst to twice the reserved capacity for message production. Basic Edition instances do not support lossless auto elasticity -- adjust reserved capacity manually to handle peak traffic.

Edition comparison

EditionSLAAuto elasticityScheduled elasticityRecommended for
Basic99.9%Not supported. Uses HDDs, OSS, and preemptible ECS instances.Not supportedTesting or stable-traffic workloads
Standard99.95%Up to 2x reserved capacitySupportedProduction workloads
Professional99.99%Max(1,024 MB/s, reserved capacity x 2). Three-zone disaster recovery.SupportedEnterprise workloads that require high availability

Size your reserved capacity

Reserved capacity is measured in MB/s and accounts for all three replicas. The sizing logic differs by edition because Basic Edition lacks auto elasticity.

Basic Edition -- reserve for peak traffic across all replicas:

Steady-state trafficPeak trafficFormulaReserved capacity
600 MB/s1,200 MB/s1,200 x 3 replicas3,600 MB/s

Standard or Professional Edition -- auto elasticity handles bursts up to 2x, so reserve for steady-state traffic:

Steady-state trafficPeak trafficFormulaReserved capacity
600 MB/sup to 1,200 MB/s600 x 3 replicas1,800 MB/s
600 MB/sup to 1,500 MB/s(1,500 x 3) / 2 = 2,250, rounded up2,300 MB/s
Note

For Professional Edition instances with small reserved capacities, a floor of 1,024 MB/s applies to elastic traffic. For example, a reserved capacity of 60 MB/s yields a maximum elastic traffic of 1,024 MB/s (not 120 MB/s). A reserved capacity of 600 MB/s yields 1,200 MB/s. Traffic beyond the elastic limit is throttled.

Use the price calculator for serverless ApsaraMQ for Kafka instances to estimate costs.

Scheduled elasticity policies

When short-term peak traffic exceeds the maximum elastic traffic, a scheduled elasticity policy temporarily increases the reserved capacity for message production or consumption. The cluster scales up before the effective period begins and scales back down after it ends, so capacity is ready when the traffic spike arrives.

Scheduled elasticity policies are available for Standard Edition and Professional Edition instances only.

Before you begin

Review the following constraints before you create a policy:

  • Minimum 60-minute interval. Space consecutive scheduled elasticity tasks at least 60 minutes apart to prevent overlapping upgrade and downgrade operations.

  • Brief client disconnections during scaling. Adding or removing brokers triggers client disconnections and reconnections for load balancing. Configure retry logic on producers and consumers to resend failed messages. Overall service availability is not affected.

  • Missed start times. If the start time of a one-time policy has already passed, the policy does not run. Recurring policies run at the next scheduled cycle.

  • Manual upgrades disable lower-capacity policies. If you upgrade the instance to a reserved capacity higher than a scheduled policy's target, that policy is automatically disabled.

Create a scheduled elasticity policy

  1. Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, select the region of your instance.

  2. On the Instances page, click the instance name.

  3. On the Instance Details page, click the Elasticity Policy tab.

  4. In the Scheduled Elasticity Policy section, click Create Scheduled Elasticity Policy.

  5. In the Create Scheduled Elasticity Policy panel, configure the following parameters:

    ParameterDescription
    Policy NameA name for the policy.
    Reserved Capacity for Message ProductionThe message production capacity during the scheduled period, in MB/s.
    Reserved Capacity for Message ConsumptionThe message consumption capacity during the scheduled period, in MB/s.
    Repeated Execution RuleHow often the policy runs. See Execution rules.
    Effective PeriodThe start and end time for the capacity change. The format depends on the execution rule.
    Effective or NotWhether the policy takes effect immediately after creation.
  6. Click OK.

The policy appears on the Elasticity Policy tab with its reserved capacities, effective period, and estimated upgrade time.

Execution rules

RuleSchedule formatDuration
Exactly-once Executionyyyy-MM-dd HH:mm. Start time must be 1 hour to 7 days from now.30 minutes to 7 days
Every DayHH:mm30 minutes to 12 hours
Every WeekSelect days of the week, then specify HH:mm.30 minutes to 12 hours
Important

The interval between two consecutive scheduled elasticity tasks must be greater than 60 minutes.

Enable or disable a scheduled elasticity policy

In the Scheduled Elasticity Policy section, find the target policy and toggle the switch in the Effective or Not column.

When a policy is active, the Policy Preview section displays the projected reserved capacities over the next 1, 2, 3, or 7 days.

Delete a scheduled elasticity policy

In the Scheduled Elasticity Policy section, find the target policy and click Delete in the Actions column.