Weblog entry #13 for sebastian

Load Balancing
Posted by sebastian on Mon 14 Aug 2006 at 13:16
Tags: none.
I'm searching for a nice solution for load-balancing a web-server on a single IP address.

Does anybody have a good idea?

 

Comments on this Entry

Posted by simonw (84.45.xx.xx) on Mon 14 Aug 2006 at 20:37
[ Send Message | View Weblogs ]
Give us some background -- why does it need load balancing. Where is the load coming from?

Do you want high availability as well, or is it okay for a session to die if a server fails. Is there even a session?

At work we run a Squid proxy in front of our web servers, which can do this, either by forwarding to two other (possibly) private addressed web servers, or other ways. But you can do the same thing with Apache, NAT, netfiler. There are entire books on the topic.

So it would help to know what the load is from, and how it is dealt with.

Also worth checking if there are easier ways to reduce load.

For example Plone on Zope is pig slow, but put an instance of Apache with mod_proxy in front on the same server, and it can serve an order of magnitude more traffic.

Perl CGI can be very load intensive, but using Fast CGI or Mod_perl can sometimes be quite easy, and resolves the load issue.

I seem to recall when I last looked for specific load sensitive web traffic balancing there was a free software one written in Haskell that looked very promising, but Google is being difficult (the people who put load balancing in the Haskell compiler are to blame ;), and I don't recall the name off hand.

[ Parent | Reply to this comment ]

Posted by sebastian (84.26.xx.xx) on Mon 14 Aug 2006 at 21:04
[ Send Message | View sebastian's Scratchpad | View Weblogs ]
Thanks for the input.

We have 2 front-end servers with tomcat 2 database servers in the back-end (1 production, 1 backup).

Right now we have a solution with uCarp and round robbing DNS. If one of the servers fail, the IP address will bind on the other server.

Is there a solution where we can drop the round robbing DNS and bind ONE and bind ONE IP address to both servers?

A colleague told me he did it on a few Windows servers. I know Windows isn't Linux but I like the idea for dropping round robbing DNS.

[ Parent | Reply to this comment ]

Posted by simonw (84.45.xx.xx) on Mon 14 Aug 2006 at 23:22
[ Send Message | View Weblogs ]
It is "Round Robin" - honest.

I've heard of configuration using the same IP address, but in most cases with sophisticated load balancing you need to track state so that the same client comes back to the same server each time. That can be done by IP address, which is simple to understand, or you push it into a load balancing switch or software load balancer.

Your current solution sounds fine it me, and can be implemented without a single point of failure easily, and can scale to multiple machines. What is you pain?

I wouldn't suggest going for solutions with one IP address, just because Windows does it. I've certainly heard of people doing that in GNU/Linux. I've also heard of one-armed load balancing, but that doesn't mean I'd leap at the chance to try them (well I would, but I wouldn't necessarily want to support it afterwards).

[ Parent | Reply to this comment ]

Posted by Nilshar (195.200.xx.xx) on Wed 16 Aug 2006 at 09:19
[ Send Message | View Weblogs ]
Take a look at : http://www.keepalived.org/ (there is a debian package).
It's mainly for HA, but I'm sure it can help you.

[ Parent | Reply to this comment ]

Posted by jeffd (64.142.xx.xx) on Wed 16 Aug 2006 at 03:58
[ Send Message ]
I was just looking for a solution for this myself. Theres a project called ultramonky that does just this. http://www.ultramonkey.org/ They have debs and an apt repository for sarge, but I just downloaded the source and got it set up on etch in about an hr. So far its looking pretty promising. It also has a way of setting up two loadbalncers that fail over as well. I haven't tested that out yet though.

[ Parent | Reply to this comment ]

Posted by Anonymous (82.168.xx.xx) on Wed 16 Aug 2006 at 22:40
A simple how-to for debian can be found here: http://howtoforge.net/high_availability_loadbalanced_apache_clust er

[ Parent | Reply to this comment ]

Posted by rkreider (70.32.xx.xx) on Fri 18 Aug 2006 at 06:01
[ Send Message | View Weblogs ]
I maintain a linux virtual server cluster of five Debian real servers at work that handle Apache requests. (Not just Apache server, but a few other services also such as DNS (intra/extra), Apache (intra/extra), Mail, etc.)

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search