Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

For example, for haproxy (layer 7) load balancing, you only need to configure the "real servers" or "backends" behind the VIP (i.e., cluster IP). E.g.:

listen smtp 192.168.3.10:25
        mode tcp
        balance roundrobin
        server smtp1 192.168.3.1:25 check
        server smtp1 192.168.3.2:25 check

However, with lvs (layer 4), I'd need to either:

  1. Set the lvs machine as the router to implement "NAT Routing"
  2. The lvs machine and the backends have the VIP configured with some ARP mods on the backends

How does layer 7 load balancing manage to do this without the more involved configuration? Am I misunderstanding or missing something fundamental here?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

With LVS, your network traffic essentially goes from the client directly to your backend server. Having a third host (semi-transparently) involved here is not a normal network configuration, which is why it's fairly difficult to implement.

With haproxy, your network traffic goes from the client to haproxy, then haproxy to the server. As far as the server is concerned, haproxy is just another client. This is a normal networking setup, so there's no network layer complexity to setup (though there is Layer 7 complexity, such as X-Forwarded-For headers). It also means that your haproxy machine is a SPOF, and needs to be able to handle the total traffic to your website.

share|improve this answer

Your Answer

 
discard

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.