Question
A company is migrating a legacy application to AWS. The company manually installs and configures the legacy application on Amazon EC2 instances across multiple Availability Zones. The company sets up an Application Load Balancer (ALB) for the application. The company sets the target group routing algorithm to weighted random. The application requires session affinity.
After the company deploys the application, users report random application errors that were not present in the legacy version of the application. The target group health checks do not show any failures. The company must resolve the application errors.
Which solution will meet this requirement?
- A. Set the routing algorithm of the target group to least outstanding requests. Correct
- B. Turn on anomaly mitigation for the target group.
- C. Turn off the cross-zone load balancing attribute of the target group.
- D. Increase the deregistration delay attribute of the target group.
Explanation
The correct answer is A because setting the routing algorithm to 'least outstanding requests' ensures that new requests are directed to the EC2 instance with the fewest active connections, which can help in maintaining session affinity and reducing random application errors. The weighted random algorithm does not guarantee session consistency across requests, leading to potential issues as observed.