Hi, Imagine for a moment ... you're stuck on a deserted island and there's no hardware load balancer vendor in sight. With only coconuts, five linux servers and an Internet connection you need to come up with a software-based load balancing scheme.
Which would you choose and why? 1) Round Robin DNS __________________ Bind enables you to map a domain name to multiple IP addresses (e.g., search.turbo10.com -> 130.54.23.24, 130.54.23.34). Setting the DNS time to live (TTL) to 60 seconds helps to prevent caching the IP address. The disadvantages of DNS round-robin include: * client DNS caching(?) may reduce the random distribution of traffic in the cluster (is it that bad?) * it does not take account of load on any individual server * a server may fail and users may experience a dropped connection The advantages of DNS round-robin include: * simple to implement * no load is born by the server to distribute the load (e.g., no need to process Apache RewriteMap) * no need for a 'point' machine to accept all incoming hits ... or ... 2) Apache Rewrite Map _____________________ This alternative can distribute the load randomly and also selectively based on the URL (e.g., http://turbo10.com/?u=1212 --> 130.54.23.24, http://turbo10.com/?u=1211 --> 130.54.23.25). The disadvantages include: * a machine must act as a proxy for all requests. * there is an extra network socket connection required between proxy and server. * all HTTP headers need to be inspected and rewritten. * proxyReversePass is needed to send cookies back to the client. * more complex to implement than DNS round-robin The advantages include: * the RewriteMap file can be updated based on load averages in the cluster. Allowing heavily loaded machines to receive less traffic and lightly load machines to receive more. * a cron job could update the map file based on load averages. * if a server goes down it can be removed from the RewriteMap (i.e., and the cluster) immediately making the loss of a server invisible to the end user. ... or ... 3) Other Software-Based Load Balancing Solution _______________________________________________ ???? Regards, NIge Nigel Hamilton