hieuhtr / Blog

Don’t be lazy. Don’t make excuses. No one cares. Work fucking harder.
Other
6 stars 2 forks source link

Request routing of AWS ELB #46

Open hieuhtr opened 7 years ago

hieuhtr commented 7 years ago

Problem & Question

The Amazon DNS servers return one or more IP addresses to the client, which are the IP addresses of the load balancer nodes for your load balancer

Usecase

Why need more than one IP?

Research & Answer

Source: http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html Request routing

Before a client sends a request to your load balancer, it resolves the load balancer's domain name using a Domain Name System (DNS) server. The DNS entry is controlled by Amazon, because your instances are in the amazonaws.com domain. The Amazon DNS servers return one or more IP addresses to the client, which are the IP addresses of the load balancer nodes for your load balancer. As traffic to your application changes over time, Elastic Load Balancing scales your load balancer and updates the DNS entry. Note that the DNS entry also specifies the time-to-live (TTL) as 60 seconds, which ensures that the IP addresses can be remapped quickly in response to changing traffic.

The client determines which IP address to use to send requests to the load balancer. The load balancer node that receives the request selects a healthy registered instance and sends the request to the instance using its private IP address.

Key: nó có 1 đống IPs bên dưới

Testing with a single client machine will result in using only one of these IP addresses. When a larger set of independent clients resolve the DNS entry and get different IP addresses to use, they will effectively spread the load amongst the full set.

https://forums.aws.amazon.com/thread.jspa?threadID=32280