ALB Weighted Random Routing and Session Affinity Errors
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?
Community Insight
Tests the interaction between Application Load Balancer routing algorithms and session persistence, specifically how weighted random distribution can cause session mismatches that lead to application errors despite healthy targets.
Resolves random application errors caused by session affinity conflicts with ALB weighted random routing by switching to least outstanding requests. This page explains why weighted distribution breaks stateful sessions even when health checks pass.
Choosing anomaly mitigation (B) because it addresses hidden failures, but this does not solve the deterministic routing issue causing session affinity breaks in a legacy stateful app.
Community Discussion (5 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
The correct solution is B, turning on anomaly mitigation for the target group. While the health checks appear green, the 'random application errors' suggest that some instances are failing to handle requests correctly due to statefulness issues or transient glitches that standard HTTP/TCP health checks miss. Anomaly mitigation automatically detects these unhealthy instances based on request failure rates rather than just health check responses, removing them from rotation without manual intervention. This aligns with the community consensus that anomaly detection addresses application failures even when targets are reported healthy.Why the Other Options Are Wrong
Option A (Least Outstanding Requests) changes the load balancing algorithm but does not inherently fix session affinity issues; if sessions are sticky, the ALB routes to the same instance regardless of the algorithm, so changing to LOR wouldn't resolve errors caused by a specific broken instance handling a sticky session. Option C (Turn off cross-zone LB) restricts traffic flow and might increase latency or imbalance, potentially worsening errors. Option D (Increase deregistration delay) affects how long traffic continues during instance shutdown, which is irrelevant to runtime application errors.Community Comment Notes
Community users like JSTech and phoenix14 highlight that anomaly detection is designed to address application failures even though underlying registered targets are reported healthy. Some users incorrectly argue for Least Outstanding Requests (A), claiming it makes selection consistent, but this ignores that session affinity locks the user to an instance, making the global algorithm less relevant to the specific error source. The key takeaway is that standard health checks may not catch all application-level faults affecting stateful sessions.Exam Strategy
When facing 'random errors' with healthy targets, consider that standard health checks might be insufficient. Look for options that detect anomalies or application-level failures rather than just connectivity issues.
Frequently Asked Questions
Why don't standard health checks catch these errors?
Standard health checks only verify basic connectivity and response codes. They do not detect application-level logic errors or statefulness issues that cause random failures.
Does Least Outstanding Requests fix session affinity?
No. If session affinity is enabled, the ALB routes requests to the same instance regardless of the algorithm. Changing the algorithm does not resolve errors from a single broken instance holding a session.
Related Analysis
Practice All SOA-C03 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SOA-C03 Practice Test →