This document describes how to use the traffic scheduling feature of EdgeOne to gradually switch traffic for a domain from the origin server to EdgeOne, ensuring a smooth business migration.
Documentation Goals
It takes about 10 minutes to learn this document, through which you can understand the following:
1. What is traffic scheduling management?
2. How can I use traffic scheduling to gradually migrate traffic and ensure high service availability?
Overview
After purchasing the EdgeOne SCDN service, you need to switch your website traffic from the origin server or other service providers to EdgeOne. In the traditional approach, users use tools to direct traffic to a specific node for testing. After the test confirms that the service is normal, all traffic is switched at once, which may cause issues in certain regions, leading to reduced availability or sudden traffic spikes on the origin server.
To ensure high service availability, a better approach is to perform gradual traffic switching for smooth business migration. EdgeOne provides a traffic scheduling management tool that allows you to customize the gradual switching ratio and pace, and control the proportion of EdgeOne-accelerated traffic on demand to ensure smooth service migration.
Prerequisites
1. Add a site by following the site access guide, purchase the EdgeOne Enterprise Edition plan, and connect the site via CNAME. 2. You have added the domain that requires gradual traffic switching in the EdgeOne console. For configuration details, refer to the domain addition guide for CNAME access mode. Preset Scenarios
Assume that the domain to be migrated is huidu.example.com, and all current traffic points directly to the origin server with the address origin.example.com.
Plan a three-phase gradual switch to EdgeOne: start with 1%, then 30%, and finally 100%.
User Guide
Step 1: Adding the Initial Canary Release Policy
1. Log in to the EdgeOne console. In the left menu bar, go to Service Overview, and click the site to configure under Website Security Acceleration. 2. After entering the site, click Domain Services > Traffic Scheduling Management in the menu bar to go to the Traffic Scheduling Management page, and then click Add Scheduling Policy.
3. On the domain selection page, select the domain huidu.example.com that requires gradual traffic switching, and click Create.
4. On the Add Service Provider page, enter the origin server domain origin.example.com because this scenario involves migration from the origin server. You can customize the service name, such as "Origin Server Domain". After adding it, click Next.
5. On the policy configuration page, add an initial gradual switching policy and submit the configuration. Consider switching 1% of traffic from the origin server to EdgeOne first, and increase the gradual switching ratio after the service runs without issues for a period of time. In the default policy, set the origin server domain weight to 99 and the EdgeOne weight to 1.
Step 2: Switching DNS Resolution to Start Canary Release
1. Switching DNS Resolution
After the policy is added, EdgeOne assigns a traffic scheduling CNAME to the domain. This CNAME is the same as the default CNAME of the domain. You also need to complete the CNAME configuration at your DNS hosting provider to trigger the traffic scheduling policy. For domain resolution switchover instructions, see Part 4 of CNAME Access. 2. Verifying the Take Effect Status
You can use the nslookup or dig command to check whether the current domain resolution has taken effect.
Open Command Prompt (cmd) on Windows. For example, for the domain huidu.example.com, you can run the following command in cmd: nslookup -qt=cname huidu.example.com. The output shows the CNAME information of the domain.
In this example, you have specified the traffic migration ratio of 1%. Therefore, if the traffic switching is successful, about 1% of the returned CNAME addresses are provided by EdgeOne. You can run the command several times. You can use the dig command for verification. For example, for the domain huidu.example.com, run the following command in the terminal: dig huidu.example.com. The output shows the CNAME information of the domain.
Because only 1% of traffic is switched, the CNAME address provided by EdgeOne appears in about 1% of the results. You can run the command multiple times. If the CNAME assigned by EdgeOne appears, the traffic switch is successful.
3. Viewing Traffic Changes
Click Data Analysis > Traffic Analysis, add a filter condition for traffic where host equals huidu.example.com, and view the traffic trend curve. For example, if the current total bandwidth is 100 Mbps, when 1% of traffic is switched to EdgeOne, the bandwidth curve in the EdgeOne console will increase to 1 Mbps.
Step 3: Increasing the Canary Release Percentage
To increase the gradual traffic switching ratio to 30%, go to the Traffic Scheduling page, select huidu.example.com, and click Manage in the operation column to enter the edit page. On the edit page, change the EdgeOne weight to 30 and the origin server domain weight to 70, and click Save. The policy takes effect immediately and becomes effective on the live network after the DNS cache expires. The verification method is the same as Step 2: Switch Resolution to Start Gradual Traffic Switching - Verify Effectiveness. Step 4: Completing the Canary Release Process
Increase the gradual switching ratio to 100% to switch all traffic to EdgeOne.
2. After running 100% gradual traffic switching for a period of time and confirming that the service is stable, you can choose to disable and delete the traffic scheduling policy. Disabling and deleting the policy does not affect your service, and all traffic continues to use the EdgeOne service, which completes the entire gradual traffic switching process.
Learn More