We currently have one web server and one DB server to serve our websites. Things have been fine but slowly getting worse as the sites consume more and more CPU on the web server. We've reached the point where we need to upgrade the web server or put things behind a load balancer.

I called our provider and they only have one CPU more powerful than what we already have and the cost can't be justified with the meager performance boost. So it's looking like we need to go the load balancer route.

My question is...How do we set this up and what kind of hardware do we need to push out avg 150Mbps, peak of 300Mbps?

We currently have one web server and one DB server. I'm guessing we need to add another web server and a load balance server to bring us to a total of 4 machines.

LB1-->Web1 | Web2-->DB1

Is this the correct setup for a relatively simple infrastructure? Would we be better off putting HAProxy on Web1 and putting HAProxy on Web2 and using each web server to load balance each other, thereby eliminating a machine?

And lastly, how do we share the web roots between the web servers? Will an NFS mount on a shared NFS server suffice or do we need to do some sort of automatic synchronization between the machines?

To summarize:

  1. What type of hardware should we be looking at for the load balancer, assuming a constant load of 150Mbps and a peak of 300Mbps? Assuming HAProxy

  2. How should the machines be organized? Do we need a dedicated box for load balancing or should we set up HAProxy on each web server, then set up DNS records pointing to both HAProxy servers?

  3. Is an NFS share sufficient for setting up the document roots or do we need to duplicate the data between the nodes via rsync or some other method?

1 Answer 1



In terms of network load, obviously you need to ensure that the network cards, firewalls, switches and/or hardware load balancers are all capable of 300Mbps with redundancy.

Apart from network traffic, you need to ensure that your processors are going to be able to handle the amount of sessions that are coming in.

If you already know you're going to have 150-300Mbps traffic, how does that equate in terms of sessions? How much does one session take to compute?

Estimate the amount of sessions you will have, plus what growth you expect, and pick a processor based on those calculations.


All of the options are valid, it just depends what is going to work for you.
You might not need to have a dedicated load balancer, but if you do tests and the results suggest otherwise then you should look into getting a physical LB.

There's nothing wrong with DNS round robin, but I would only use such a thing in a simple configuration where sessions don't need to be retained across both servers, and so on.


Once again, either option is valid.

Syncing data between the servers will introduce a dependency on fast and reliable replication, which may or may not be available in certain cases.

What happens when one server syncs and the other doesn't? The sites may still work but they will have different data. How will you check for that?

If you set up NFS and the NFS goes down, how will the servers handle that? Local cached copies? Again, what if one has an out of date local cached copy? You could look at a clustered NFS to add in redundancy. It all depends on how critical your service is going to be.

As a final note, I will say that often times adding in more redundancy just complicates things and creates more points of failure than it takes away.

I hope this helps.

  • Thank you for your thoughtful reply. Believe me, I would rather stay on the one web server like we have now, but I've delayed this for as long as possible. When you're maxing out the specs available to you from the DC, it may be time to look at scaling..... 1. This one is bugging me the most because I literally have no idea where to look. We have 5-6K users online at once amongst all of our websites. The web servers are doing the heavy lifting, but I don't know how well HAProxy will run with that many users and an E3-1270v3 processor with 16GB RAM. I just don't have a metric to compare to.
    – Kevin
    Feb 5, 2014 at 2:39
  • If you know how many users you have connecting, you can emulate that amount of traffic using benchmarking software. If your suppliers are kind, they can give you some machines to test on. Do a staging environment, set up the load balancers and blast it with a benchmarker. I would benchmark at 125% of the actual expected load to allow for unpredictable performance issues when it finally comes into production. Feb 5, 2014 at 2:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.