Open this lesson in your favourite AI. It'll walk you through the why, explain the demo, and quiz you on the try-it list.
Round-robin sounds fair until one backend's GC pause makes it the slowest in the pool — round-robin happily keeps sending it 1/N of traffic anyway. Picking the wrong algorithm means your p99 latency is set by your slowest replica even when 9 out of 10 are healthy.
Configure and inspect different LB algorithms on a managed cloud load balancer.
SourceIP distribution and verify the same client always hits the same backend across 50 sequential requests.Use these three in order. Each builds on the one before.
In one paragraph, explain the four common load balancing algorithms (round-robin, least-connections, IP hash, weighted) like I'm new to load balancing.
Walk me through how a least-outstanding-requests algorithm makes its routing decision per request, and what state it has to track per-backend.
Given a stateful WebSocket service with sticky sessions and a planned rolling deploy, choose between IP hash and consistent hashing — defend the choice.
# ALB target group attributes — round-robin (default) vs least-outstanding
aws elbv2 modify-target-group-attributes \
--target-group-arn <tg-arn> \
--attributes Key=load_balancing.algorithm.type,Value=least_outstanding_requests
# Verify
aws elbv2 describe-target-group-attributes --target-group-arn <tg-arn> \
--query 'Attributes[?Key==`load_balancing.algorithm.type`]'
# Weighted target groups (canary 90/10)
aws elbv2 modify-listener --listener-arn <l-arn> \
--default-actions '[{"Type":"forward","ForwardConfig":{"TargetGroups":[{"TargetGroupArn":"<v1>","Weight":90},{"TargetGroupArn":"<v2>","Weight":10}]}}]'