- Newest
- Most votes
- Most comments
Route 53 normally returns all the IPs of the load balancer, unless health checks have removed some of the nodes temporarily from service. It's the client that decides which of those ALB IP addresses to connect to.
You can see the IPs in practice by querying the load balancer's DNS name with a command line tool, such as dig
or nslookup
. You'll also see that they are returned in random order to the application that made the query.
In addition to the above explanation, it’s important to note that AWS doesn’t fully disclose the exact method the Application Load Balancer (ALB) uses to route traffic to internal servers behind the ALB(The Application Load Balancer uses its internal logic to determine which target group and instance to route the traffic to from this link).
For example, if you’re using an ALB across two subnets, it typically starts with two internal hosts, which you can view through the associated ENIs (Elastic Network Interfaces). As traffic increases or decreases, the number of ENIs—and consequently the internal servers handling traffic—will adjust accordingly.
While the internal logic for routing is handled automatically by AWS, and we don’t have direct control over it, we can influence routing behavior through several configuration settings. These include load_balancing.algorithm.type
, load_balancing.cross_zone.enabled
, and stickiness.enabled
, among others.
For more details on how to configure target groups and routing, you can refer to AWS's documentation here: Target Group Attributes.
Relevant content
- asked 9 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
The algorithm the ALB uses to select the target for a request it's already received (after the client first chose at random which ALB IP to send it to) is configurable, and both the default option and the alternatives are described in the section "Routing algorithms" on that same documentation page: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#modify-routing-algorithm