PDA

View Full Version : Loadbalancer Recommendation?


reteep
12-12-2007, 05:38 AM
We already splitted web and db server on two dedicated servers, running lighttpd, php fcgi and MySQL5.

However, the load of the webserver is pretty critical, can anyone recommend good software Loadbalancers?

Thanks!

Kentaurus
12-14-2007, 06:36 AM
Yes, I myself like pound
http://www.apsis.ch/pound/

It doesn't have a pretty gui, but is highly configurable and low on resource usage.

Please share your experience with us afterwards, load-balancing a vbulletin sounds like a challenge, especially if storing the avatars/attachments in the filesystem

weeno
12-15-2007, 02:56 AM
I have a round robin on two php servers for now. It works reasonably well, but can get off-balance with high traffic.

There are a few issues that you run into with splitting the php servers into two though, as mentioned above.... mostly you can't save anything to files (attachments, js, avatars) without making modifications.

arn

reteep
12-15-2007, 07:26 AM
Thanks, we decided to give pound a try, I'll keep you informed about our results.. and yes, we do store avatars/attachments in the filesystem :o

amcd
12-16-2007, 08:51 AM
lighttpd itself is the best load balancer around.

TECK
12-16-2007, 03:02 PM
lighttpd itself is the best load balancer around.
I totally agree.

1 webserver (lighttpd)
- 10.0.0.10
4 php-fastcgi-backends
- 10.0.0.20 ... .23

The config snippet for lighttpd:
fastcgi.server = (
".php" => (
("host" => "10.0.0.20", "port" => 2000, "broken-scriptfilename" => "enable"),
("host" => "10.0.0.21", "port" => 2000, "broken-scriptfilename" => "enable"),
("host" => "10.0.0.22", "port" => 2000, "broken-scriptfilename" => "enable"),
("host" => "10.0.0.23", "port" => 2000, "broken-scriptfilename" => "enable")
)
)

reteep
12-17-2007, 09:47 AM
Oh, didn't know that this is possible, sounds like a great alternative, thanks!

tonyzhou
12-18-2007, 10:36 PM
Nginx is a better load balancer but not as configurable as lighttpd.

TECK
12-19-2007, 07:45 PM
I like that Nginx doesn't suffer from memory leak (http://trac.lighttpd.net/trac/ticket/758) over time. But you will need to "steal" lighty's files (spawn-fcgi), in order to get it working with PHP5 and XCache. I will give it a try and let you know.

HDT
12-20-2007, 12:34 AM
Thanks for this info,will try this alternative.

TECK
12-21-2007, 04:27 AM
I've made a RPM for Nginx. This thing is really amazing, performance wise.
The lighty memory leaking is present only when you use PHP4, so who cares... The configuration is a little primitive... plus I had to patch the hell of build files to make it 100% compatible with CentOS 5.1.
Still, the results are impressive.

I'm going to do a deep analysis and let you guys know about my results.
Let see how is the server load is on a web cluster with 5,000 hammering users...

EDIT: This is an interesting read:
http://hostingfu.com/article/nginx-vs-lighttpd-for-a-small-vps

EricGT
12-25-2007, 01:46 AM
I am now running my site on two very powerful servers, but before I bought these systems, I was running a dual Xeon DB server and six dual processor P-III front end servers. I started out using round-robin DNS. The DNS method is problematic because it has no real failover capability and it does not distribute traffic evenly. The first box in the list gets twice as much traffic as the middle boxes and the last box gets about 50% more. I used a common NFS share on the DB server for my images directory.

I next used Pound and it worked much better for me. I am now running an Astaro firewall, which has built-in load balancing capability, although I am not currently running multiple front-end boxes. Eric

amcd
12-25-2007, 08:05 AM
On most websites, and certainly on any vbulletin forum, the load on the webserver is never an issue. Almost any hardware can easily handle that.

The problem is almost always PHP. (Of course, MySQL load is also an issue but that is a different topic altogether.) Now, if only you can decouple PHP from the webserver (dont use mod_php, i feel FastCGI is best), you can use multiple servers for PHP processing. You just just need a webserver which can interface with multiple backend processes over TCP/IP. My experience with lighttpd for this has been absolutely fabulous.

TECK
12-27-2007, 07:30 PM
amcd, I used to be a fervent lighty user until recently, when I discovered nginx (http://www.vbulletin.com/forum/showthread.php?t=253741).
Then, I realized what I was missing all this time... I will NEVER go back to lighttpd. :)

Isn't that a lot easier?

upstream vbulletin {
server 192.168.1.2:9000 weight=3;
server 192.168.1.3:9001;
server 192.168.1.4:9002;
}

server {
listen 80;
server_name vbulletin.com www.vbulletin.com;

location / {
proxy_pass http://vbulletin;
}
}

EricGT
12-27-2007, 08:49 PM
As much as I have learned over the years, it is always a bit humbling to come and hang out on a site like this and see how much I have left to learn. This is the problem with being self-taught and not networking with other geeks of a feather. I never know what I am missing out on.:D

amcd
12-28-2007, 05:46 AM
Thanks for the info, Teck. I will try to install nginx on one of my smaller sites which I am going to revamp next week.