All Products
Search
Document Center

Server Load Balancer:Mirror production traffic to a staging environment

Last Updated:Nov 16, 2023

This topic describes how to mirror production traffic to a staging environment for Application Load Balancer (ALB).

Scenarios

For enterprises that have a high requirement for service security and stability, new features must be tested separately from the production environment before they are released. This prevents service interruptions.

ALB supports traffic mirroring, which can mirror production traffic to backend servers in a staging environment. Meanwhile, ALB automatically drops responses from the backend servers in the staging environment to ensure that the tests do not affect workloads in the production environment. Traffic mirroring is ideal for the following scenarios:

  • Test new features and service performance.

  • Replicate production traffic for testing purposes without the need to create additional data.

  • Reproduce errors for troubleshooting.

镜像流量仿真

Limits

  • Both Internet-facing ALB instances and internal-facing ALB instances support traffic mirroring.

  • Basic Edition ALB instances do not support traffic mirroring.

Prerequisites

Mirror network traffic

  1. Log on to the ALB console.
  2. In the top navigation bar, select the region where the ALB instance resides.

  3. On the Instances page, click the ID of the instance that you want to manage.

  4. On the Listener tab, find the listener that you want to manage and click View/Modify Forwarding Rule in the Actions column.

  5. Choose Forwarding Rules > Inbound Forwarding Rules and click Add Forwarding Rules.

  6. In the Add Forwarding Rules section, set the parameters of the forwarding rule.

    In this example, network 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.

    Important

    ALB drops responses from backend servers in staging environments. Therefore, you must set the Forward To parameter to route network traffic to backend servers in the production environment to prevent service errors.

  7. Click OK. After you complete the configurations, network traffic that is sent to Server Group A can be mirrored to Server Group B.

References

Manage forwarding rules for a listener