Optimizing HAproxy for maximum throughput?

From: Angsuman Chakraborty <angsuman#taragana.com>
Date: Tue, 06 Jan 2009 08:14:33 +0530


I am looking at nginx (as a proxy) and haproxy to setup a cluster of machine to serve WordPress blogs. Initially I was going with nginx but the biggest problem with nginx is that I have no way to limit the number connection to a machine (even with fair load balancer) which haproxy does. This is a big issue with apache servers because 3 out of 4 machines appears to hang with heavy spike loads, requiring manual restarts (any input on this issue would be appreciated though I understand it is not the right forum for this).

Haproxy works like a champ by protecting the server. However I expected it to queue the requests in its global queue. It didn't seem to happen that way as per the stats console.
1. Why *isn't haproxy queuing the requests*? What parameters should I tweak to queue requests upto a reasonable level?

The biggest problem I am having is that the throughput is much lower than that of nginx. *
2. What can we do to improve the overall throughput* *of haproxy*? My haproxy configuration is:

        log   local0
        log   local1 notice
        maxconn 32000
        chroot /usr/share/haproxy
        uid 99
        gid 99
        ulimit-n 65536

        log     global
        stats   enable
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        maxconn 2408
        contimeout      30000
        clitimeout      60000
        srvtimeout      30000
        timeout connect 10000

listen  nginx-pool
        option  httpchk GET /test
        balance leastconn
        server  fighter cookie fighter weight 2 minconn 
25 maxconn 75 check inter 30000 maxqueue 200
        server  workhorse cookie fighter weight 4 minconn 
30 maxconn 100 check inter 30000 maxqueue 400
         server  testing cookie fighter weight 4 minconn 
30 maxconn 100 check inter 30000 maxqueue 400
        server  apollo cookie fighter weight 3 minconn 30 
maxconn 100 check inter 30000 maxqueue 300
        server  margay cookie margay weight 1 minconn 20 
maxconn 75 check inter 30000 maxqueue 100

3. *Is sepoll better than epoll for Linux 2.6.x kernel*? I am using Fedora 8 distro.

Any pointers & help will be highly appreciated.

It's a nice product, keep up the great work.


Angsuman Chakraborty
CEO Taragana Inc.
http://www.taragana.com | http://blog.taragana.com | http://angsuman.taragana.net

You can follow me on twitter - http://twitter.com/angsuman
AIM: angsuman, Yahoo IM: angsuman

Received on 2009/01/06 03:44

This archive was generated by hypermail 2.2.0 : 2009/01/06 04:00 CET