Thursday, July 25, 2013

The most common mistake when load balancing with HAProxy

So, a while back, I was put in charge of a medium-sized site, which is running Drupal (probably known best for it's performance -- or lack thereof). At some point, we had to scale the website up, because it was getting more and more attention, so we went with HAProxy, because we heard good things about it. (We tried Amazon ELB, because we were already in the Amazon network, but that didn't work out for us)

So we installed HAProxy and pulled some different configurations on the internet, and got something working. This was about 1.5 years ago, and at that time, the website was getting about 900k unique visitors.

At first, the website was handling the traffic fairly OK with just 2 servers under the LB. Then we had to add another server, because we've developed some new features, with a major impact on the site's performance (we weren't allowed to switch from Drupal, so we couldn't optimize the code too much).