3

I am looking for an open source loadbalancer for linux. My requirements are simple. I want One load balancer infront of multiple webservers. It should be able to split the load evenly among the webserver using a round robin fashion. Easy to install and simple to use. Moreover I want to add webservers dynamically(on the go) to the loadbalancer without the need to stop/restart the loadbalancer.

Thanks for your help.

-Sethu

dmourati
  • 24,720
  • 2
  • 40
  • 69
sethu
  • 371
  • 2
  • 16
  • 2
    possible duplicate of [Software http load balancer?](http://serverfault.com/questions/433/software-http-load-balancer) – pauska Jun 09 '11 at 16:05
  • I tried various load balancers like Balance, Distributor, Apache's mod_proxy_balancer. I have a client program that creates nearly 100 threads that tries to ping the WS ( in this case through a loadbalancer). In all the load balancers I tried, after a minute i get connection time out error. In the apache error log I found : do_ypcall: clnt_call: RPC: unable to send;errno = Operation not permitted . I still dont understand what it means and how to solve it. – sethu Jun 09 '11 at 21:14
  • Thanks for your views, I used Apache's mod_proxy_balancer and it works, but at times i get 503 error and in the logs i find all servers are in error state. Any idea about this ? – sethu Aug 22 '11 at 18:28

4 Answers4

1

Have a look at LVS (ipvs) LinuxVirtualServer I'm using it for load-balancing a proxy cluster. It has both simple round-robin and more complicated balancing policies.

HUB
  • 6,322
  • 3
  • 22
  • 22
  • Will I be able to add nodes dynamically to it ? – sethu Jun 08 '11 at 15:29
  • @sethu, you need to tell the load balancer (LVS) the name and port you want to use on your webservers. You could pre-configure a bunch that don't yet exist. If then you added them by starting web services up there, the load balancer could pick them up and start sending work to them. – dmourati Jun 08 '11 at 16:08
  • @sethu, Of course, it is possible. Moreover, LVS is able to load balance any TCP or even UDP service. Dynamical balancing (according to worker hosts availability) can be made with "ldirectord" monitoring daemon. – HUB Jun 08 '11 at 18:21
  • I tried the installation of LVS. But It seems we have to compile it with the kernel. Is it possible to install it as a tool and use it. The installation looks a bit complicated. Or have I understood it the wrong way? – sethu Jun 08 '11 at 19:33
  • 1
    LVS needs a kernel module, but doesn't you Linux distro has it compiled? – HUB Jun 09 '11 at 08:15
  • That was probably very old documentation @sethu. – dmourati Jun 09 '11 at 16:29
  • I was looking at this documentation : http://www.austintek.com/LVS/LVS-HOWTO/ – sethu Jun 09 '11 at 23:19
  • I was using these (select you variant ): http://www.linuxvirtualserver.org/VS-NAT.html http://www.linuxvirtualserver.org/VS-IPTunneling.html http://www.linuxvirtualserver.org/VS-DRouting.html As for me, I used ip-tunneling variant because my worker-nodes are in different network segments. – HUB Jun 10 '11 at 08:35
  • If you want some more advanced settings or want to change the load depending on the reaction time of your webservers have a look at lvs-kiss. That`s a daemon written in perl an will change your ipvsadm setup autmatically. The syntax of the configuration file resembles httpd.conf. – Nils Aug 23 '11 at 19:25
1

Nginx allows you to change the configuration on the fly. See the section "Loading a New Configuration Using Signals" here

HTTP500
  • 4,827
  • 4
  • 22
  • 31
1

haproxy will do this as well.

I have setup Keepalived for various clients. It automates all the IPVS stuff.

Wim Kerkhoff
  • 901
  • 1
  • 5
  • 12
-1

Would a simple DNS load balancing work for you?

Alex
  • 3,079
  • 20
  • 28
  • 1
    DNS roundrobin is a poor choice for load balancing, and definitely doesn't fit the OP's requirement for dynamically configuring services. – JimB Jun 09 '11 at 16:02
  • The only thing mentioned is load balance via Round Robin and to add webservers...not services and even less in a dynamic way. Sorry to say but I don't think my suggestion deserved a -1... – Alex Jun 09 '11 at 19:12
  • there's a difference between balancing a webserver(a service) and a physical webserver, and DNS can't make that distinction. He *does* day that he wanted to add servers dynamically (with a "load balancer", and "on the go"), which you can't do easily with DNS due to multiple layers of caching, and keeping reasonable TTL's for the records. Finally, DNS roundrobin is a poor load-balancing solution in and of itself. – JimB Jun 09 '11 at 21:05
  • DNS roundrobin can also break some applications on recent browsers (I've caught chrome and safari doing this), because they'll cache all IP address for a host, and rotate them internally, sending subsequent requests to each server. Webapps often rely on some state through a series of redirects, and this is broken when the dns changes during the chain of requests. – JimB Jun 09 '11 at 21:08