about load balancing?

Amazon Web Services Developer Community :

Round Robin DNS If you want a simple approach to load balancing, you could use a round robin DNS. To accomplish round robin DNS load balancing, you would add multiple A records pointing to the IP addresses of your Amazon EC2 application servers. As you add and remove application servers from your pool, you would need to either manually modify your DNS records to reflect the changes or use an API provided by your DNS provider (http://www.dnsmadeeasy.com/ provides an API to configure DNS settings). Changes made to DNS records take time to propagate depending upon the TTL of the DNS record and other factors. More information on the pros and cons of a round robin DNS can be found here http://en.wikipedia.org/wiki/Round_robin_dns HA Proxy If you are using HA proxy, you can point your DNS records to the Elastic IP address of your HA proxy server. Your proxy server would need to be configured to point to your application instances using the HA proxy configuration file (http://haproxy.1wt.eu/download/1.2/doc/haproxy-en.txt). One of the configuration options for a HA proxy is to register each instance using roundrobin DNS. You will need to work with the HA proxy support means and documentation for specific implementation details. Having a single HA proxy server as your load balancer would introduce a single point of failure into your architecture, so you will need to take this into consideration. Each application instance could send a heartbeat message (through varying implementations) to your load balancer instance to let the load balancer know the instance is still available. A heartbeat implementation architecture would be specific to the requirements of your project. A nice thread on this topic can be found on the Amazon EC2 forums (http://developer.amazonwebservices.com/connect/thread.jspa?messageID=86785&). You might also be interested in a popular monitoring system, Nagios (http://www.nagios.org/). More information on HA Proxy can be found at http://haproxy.1wt.eu/. >> How i map more instances with the DNS, as we are creating more instances dynamically? If you are scripting the dynamic creation of an Amazon EC2 application instances, the instances could send some sort of update to your load balancer to let it know the instance was launched. This update would cause the load balancer to update the HA proxy configuration file and add the additional instance IP address. Other approaches Alternatively, there are managed DNS failover systems available such as http://www.dnsmadeeasy.com/s0306/prod/dnsfosm.html Using a DNS failover system an a round robin configuration, you could create a nice fault tolerant load balanced cluster. If you are interested in a managed Amazon EC2 load balancing, scaling, and monitoring system, you may want to take a look at RightScale (http://www.rightscale.com/) or Scalr (http://www.scalr.net/). >> and what is the internal and external IP for Amazon? A nice description of public and private IP addresses can be found in the Amazon EC2 developer guide. Let us know if you have any specific questions. http://docs.amazonwebservices.com/AWSEC2/2008-05-05/DeveloperGuide/index.html?instance-addressing.html

1 comment so far

  1. DeltaTango on

    > One of the configuration options for a HA proxy
    > is to register each instance using roundrobin DNS.

    On the contrary. What haproxy does is not round-robin DNS but round-robin load balancing. That’s two different things.

    And some DNS fiddling for fault tolerance is the almost worst “solution” as it takes way too much time for any record changes to propagate through the internet. Even with very short TTLs (which OTOH will raise your DNS traffic horribly).

    Better build a cluster of two load balancers and let them monitor each other via heartbeat. And only when one cluster cannot handle the load anymore, a second (third) cluster and DNS round-robin kicks in.


Leave a reply