Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to do load balancing.

To do this I would like to use LVS and apache as load balancer.

My configuration will be like this :

users -> internet -> LVS load balancer -> Apache balancer -> Real servers

Do you think it's possible?

In this configuration I don't know if I need two load balancers or only one with LVS & Apache together.


share|improve this question
Why do you want an apache load balancer (assuming mod_proxy_balancer)? Having LVS AND mod_proxy_balancer is redundant, and one of your balancers would be wasting CPU. – Patrick Feb 11 '11 at 2:31
Lvs is layer 4 and mod_proxy is layer 7. I read that if we do the both, the architecture is more scalable and can evoluate easier. does it true or you think only one balancer is enough? – tranen Feb 11 '11 at 3:13
It may be enough depending on your needs. – Khaled Feb 11 '11 at 7:38
As mentioned in the comments that apache load balancing in your setup might be unnecessary. To what level are you trying to scale? – Sameer Feb 15 '11 at 3:46

Haproxy would replace both the LVS and Apache mod_proxy. It can do load balancing generically at Layer 4 (any TCP port) and Layer 7 with an indepth understanding of HTTP. Persistancy is no problem.

share|improve this answer

It is definitely possible. We have LVS sitting in front to balance all requests, including email, web, etc. Then on the web nodes we have Apache mod_proxy sending back to Oracle servers. LVS doesn't cut it with multiple web node Oracle servers because of how persistence works, where Apache works just fine.

We have two LVS balancers (one acting as failover) and two Apache servers, but only one Apache server balances back to Oracle. We have this set up through the front-end balancers as they pass one routable IP to standard web traffic on both servers, and a second routable IP to pass Oracle traffic to a single Apache node. We then weight the non-Oracle Apache node higher since it is not handling Oracle balancing (and SSL encryption to Oracle for that matter).

Standard traffic:
Users -> Internet -> Firewall -> LVS -> Apache0 (Weighted heavier)
                                     -> Apache1
                                     -> Email0
                                     -> Email1
                                     -> Other Services

Oracle traffic:
Users -> Internet -> Firewall -> LVS -> Apache1 -> Oracle Web0
                                                -> Oracle Web1
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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