This topic describes how to use the traffic mirroring feature of Application Load Balancer (ALB ) to simulate service traffic.
A growing number of enterprises have high requirements for security and stability of their online services. Before an enterprise officially releases a new feature, the feature must be tested. To ensure that online services are not interrupted, the test must run in a staging environment where service traffic is simulated.
- Test new features and service performance.
- Simulate online service traffic without the need to create additional data.
- Simulate online issues to troubleshoot errors.
- Server Group A is deployed to provide online services and Server Group B is deployed to provide the staging environment. The HTTP protocol is used by backend servers. For more information, see Manage server groups.
- A listener is created. For more information, see Add an HTTP listener, Add an HTTPS listener, or Add a QUIC listener.
Simulate online service traffic by using traffic mirroring
- Log on to the ALB console.
- In the top navigation bar, select the region where the ALB instance is deployed.
- On the Instances page, click the ID of the ALB instance.
- On the Listener tab, find the listener and click View/Modify Forwarding Rule in the Actions column.
- Choose Add New Rule. , and click
- In the Add Forwarding Rules section, set the parameters.
In this example, traffic from the /test Path is mirrored to servers in Server Group B.Action: Set Traffic Mirror to Server Group B and Forward to Server Group A.Notice ALB drops the responses from Server Group A. Therefore, you must set Forward to Server Group A. This ensures that your online services are not affected.
For more information about the parameters, see Manage forwarding rules for a listener.
- Click OK to mirror the specified traffic to Server Group B.