All Products
Search
Document Center

Anti-DDoS:Configure session persistence

Last Updated:Nov 28, 2024

If you experience logon timeouts or disconnections after adding your non-website service to Anti-DDoS Proxy, consider enabling the session persistence feature. This ensures that requests from the same client are consistently forwarded to the same backend server within a specified period. This topic describes how to configure session persistence.

Usage notes

  • You cannot configure session persistence when Application-layer Protection is enabled in port forwarding settings.

  • You may configure session persistence if Application-layer Protection is disabled in the port forwarding settings. However, if Application-layer Protection is later enabled, any existing session persistence configuration will remain but will no longer be effective.

Prerequisites

A non-website service is added to Anti-DDoS Proxy. For more information, see Manage forwarding rules.

Configure session persistence for a single port

  1. Log on to the Anti-DDoS Proxy console.

  2. In the top navigation bar, select the region of your instance.

    • Anti-DDoS Proxy (Chinese Mainland): If your instance is an Anti-DDoS Proxy (Chinese Mainland) instance, select Chinese Mainland.

    • Anti-DDoS Proxy (Outside Chinese Mainland): If your instance is an Anti-DDoS Proxy (Outside Chinese Mainland) instance, select Outside Chinese Mainland.

  3. In the left-side navigation pane, choose Provisioning > Port Config.

  4. Select the instance, find the forwarding rule you want to manage, and click Session Persistence under Configure.

  5. Enable Session Persistence, set the Timeout Period (in seconds, ranging from 30 to 3600), and click OK.

    Upon successful activation, the Session Persistence status will change to Enabled.

Configure session persistence and health checks for more than one port forwarding rule

  1. Log on to the Anti-DDoS Proxy console.

  2. In the top navigation bar, select the region of your instance.

    • Anti-DDoS Proxy (Chinese Mainland): If your instance is an Anti-DDoS Proxy (Chinese Mainland) instance, select Chinese Mainland.

    • Anti-DDoS Proxy (Outside Chinese Mainland): If your instance is an Anti-DDoS Proxy (Outside Chinese Mainland) instance, select Outside Chinese Mainland.

  3. In the left-side navigation pane, choose Provisioning > Port Config.

  4. On the Port Config page, select the instance that you want to manage and choose Batch Operations > Add Session and Health Check Settings.

  5. In the Add Session and Health Check Settings dialog box, enter the required information as shown in the sample file and click OK.

    Note

    You can export health check settings to a TXT file, modify the settings in the TXT file, and then copy and paste the settings to the Add Session and Health Check Settings dialog box. For more information, see Export configurations of multiple websites.

    The formats of session persistence and health check settings must meet the following requirements:

    • Each line represents a forwarding rule.

    • From left to right, the fields in each port forwarding rule indicate the following parameters: forwarding port, forwarding protocol, session persistence timeout period, health check type, port, response timeout period, check interval, unhealthy threshold, healthy threshold, health check path, and domain name. The supported forwarding protocols are TCP, HTTP, and UDP. The session persistence timeout period is measured in seconds, and the valid value ranges from 30 to 3600. Fields are separated by spaces.

    • Port forwarding ports must be the ports that are specified in port forwarding rules.

    • If a port forwarding rule uses UDP, we recommend that you configure a UDP health check. If a port forwarding rule uses TCP, we recommend that you configure a TCP health check (Layer 4 health check) or HTTP health check (Layer 7 health check).

    • If you configure an HTTP health check, the Health Check Path parameter is required, but the Domain Name parameter is optional.