Posts Tagged ‘load balancing’

Load balancing on the cheap: DNS balancing

Thursday, July 3rd, 2008

So you can’t afford a F5 load balancer? But your Apache server is dying under the load?
We had to use load balancing using DNS because we had scaling issues. Fast and good fix (just add a box and one line of code).

Create different DNS entries for different front side Apache servers:
www1.example.com
www2.example.com
www3.example.com

And in your code (PHP):

$baserUrl = "www".rand(1,3).".example.com";

Source