Get started by creating a waiting room

更新时间:
复制 MD 格式

The Waiting Room feature queues excess traffic at the edge when demand exceeds your origin server's capacity, protecting it from overload during flash sales or high-traffic events while showing users their estimated wait time.

Configure a basic waiting room for a flash sale in 5 minutes

Assume your origin server handles up to 300 concurrent users. Configure a waiting room for the flash sale page at promo.example.com/flash-sale to protect it.

Procedure

  1. In the ESA console, select Websites, and then click the target site in the Website column.

  2. In the navigation pane on the left, choose Traffic > Waiting Room.

  3. In the Waiting Room area, click Create Waiting Room. Fill in the following core parameters:

    • Waiting Room Name: flash-sale-room

    • Hostname and Path: promo.example.com/flash-sale

      • Subdomain: promo

      • Path: flash-sale

    • Custom Cookie: __aliwaitingroom_flash_sale (queueing credential)

    • Total Active Users: 300 (match this to your origin's concurrent capacity)

    • New Users per Minute: 300 (admits all users quickly at event start)

    • Session Duration: 5

Result verification

The waiting room is enabled by default. When concurrent users on promo.example.com/flash-sale exceeds the Total Active Users limit of 300, excess users see a waiting page with their estimated wait time.

image

Create a waiting room

Follow these steps for more granular control.

Step 1: Waiting Room Settings

Configure the basic information, capacity, and admission rate for your waiting room in this step.image

Basic Information

Parameter

Description

Waiting Room Name

Set a recognizable name, such as promo_activity_room.

Hostname and Path

The exact URL where the waiting room is active. Applies only to the specified Subdomain and Path. Example: If the hostname is event.example.com and the path is /route, the waiting room only applies to requests for event.example.com/route.

Custom Cookie

Identifies and tracks each user's queue status. The cookie name has a fixed prefix of __aliwaitingroom_. Customize the suffix. Example: __aliwaitingroom_promo_user.

Waiting Room Settings

image

Parameter

Description

Total Active Users

Purpose: Maximum concurrent users allowed on the origin server.

Description: Set this based on your origin's actual concurrent capacity. When active users reach this threshold, new requests enter the queue.

Note: Minimum value is 200. If your origin handles fewer than 200 concurrent users, set this to 200 and use New Users per Minute to control the admission rate.

New Users per Minute

Purpose: Maximum new users admitted from the queue per minute. Controls load growth rate.

Description: Determines queue processing speed. For example, setting this to 300 admits up to 300 users from the waiting page per minute.

Note: The minimum value is 200. It must be less than or equal to Total Active Users.

Session Duration

Purpose: How long a user's session remains valid after leaving the queue.

Description: If a user leaves the origin (for example, by closing the page) and returns within this period, they skip the queue. Default: 5 minutes.

Disable Session Renewal

Purpose: Whether a user's session timer resets during active browsing.

Note: The toggle name is the opposite of its effect:

  • Off (Default): Enables session renewal. Active users keep their session alive and are not re-queued. Suitable for most scenarios.

  • On: Disables session renewal. The session timer starts when the user enters the origin and does not reset. Once expired, the user re-queues even if still browsing. Suitable for strict visit-duration control, such as flash sales.

Queuing Method

Policy for admitting users from the queue.

  • FIFO: Admits users in request order. Recommended default.

  • Random: Randomly selects users from the queue. Suitable for lotteries or scenarios where order does not matter.

  • Reject All: Sends all new users to the waiting page without admitting any. Useful for pre-event warm-ups, maintenance, or emergencies.

  • Passthrough: All requests bypass the queue and go directly to the origin. Effectively disables the waiting room. Use to restore normal access after an event or for testing.

Step 2: Custom Settings

Configure the page content or API response that queued users see.image

Parameter

Description

Type

Default Waiting Room: A system-provided waiting page that displays the estimated wait time. You can select a Default Language Template (English, Simplified Chinese, or Traditional Chinese).

Custom Waiting Room: Lets you upload a custom HTML page. To use this feature, contact your sales representative.

  • You can edit the template or directly import an .html file (up to 50 KB in size).

  • You can use dynamic variables (such as ${waitTime}) in the HTML to display queue information.

Preview

Preview the waiting page in different states, such as Queuing or Queue All.

JSON Response

Purpose: Provides structured queue status for non-browser clients (apps, miniapps).

Enable this toggle. When a request includes the Accept: application/json header, ESA returns queue status as JSON instead of an HTML page. JSON response parameter descriptions.

Interaction flow:

  1. First request: Access the target URL with the Accept: application/json header.

  2. Get and store the cookie: Save the Set-Cookie value from the ESA response as the identity credential for subsequent requests.

  3. Poll for status: Include the cookie in each request. Re-request the URL at the interval specified by the refreshIntervalSeconds field in the response body.

  4. Access the origin: When inWaitingRoom changes to false, the client has left the queue and can access origin resources with the cookie.

Response example:

{
  "WaitingRoom": {
    "inWaitingRoom": true,
    "waitTime": 5,
    "waitTimeKnown": true,
    "waitTimeFormatted": "5 minutes",
    "queueIsFull": false,
    "queueAll": false,
    "lastUpdated": "2024-09-10T12:00:00.000Z",
    "refreshIntervalSeconds": 20
  }
}

Queuing Status Code

HTTP status code returned to queued users. Default: 200. Change to another code such as 202 as needed.

Step 3: Review

  1. The Review page displays all settings from Step 1 and Step 2 in a read-only view. After confirming the parameters, click OK to create the waiting room.

    image

  2. The waiting room is enabled by default after creation.

    image

  3. Toggle Queue All on or off as needed:

    • Off (default): Excess requests enter the queue when Total Active Users and New Users per Minute thresholds are reached.

    • On: All new visitors must queue. Use for product launches or scheduled events.

      Note
      • Active users continue their sessions and are not re-queued until their session expires.

      • Queue All overrides all other waiting room settings, including event settings.

    image

What to do next

As an Enterprise user, you can use these advanced features: