1

I have 2 apache2 servers running in the back end and have a haproxy between them and the clients. If I bench tested anyone of these apache2 severs with ab i get north of a 1500TPS however when I bench test the HAproxy I get less than this value. Which doesn't make sense.

I am using simple round robin algorithm for the balancing and I have my maxconn set at 8000 for good measure.

What i expected was a tps approaching the combined tps of each apache2 node(2800TPS). Instead I got a value less than any one of the two apache2 nodes. What could be the cause?

The bench test i did

ab -t 60 -c 400 haproxyIP:1234

HEre is the HAproxy config very standard but should accomplish what i require.

 global
    log /dev/log    local0
    log /dev/log    local1 notice
    chroot /var/lib/haproxy
    maxconn 8000
    user haproxy
    group haproxy
    daemon

 defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    maxconn 8000
    contimeout 5000
    clitimeout 50000
    srvtimeout 50000
    errorfile 400 /etc/haproxy/errors/400.http
    errorfile 403 /etc/haproxy/errors/403.http
    errorfile 408 /etc/haproxy/errors/408.http
    errorfile 500 /etc/haproxy/errors/500.http
    errorfile 502 /etc/haproxy/errors/502.http
    errorfile 503 /etc/haproxy/errors/503.http
    errorfile 504 /etc/haproxy/errors/504.http

listen public :1234
   stats enable
   stats auth username:userpassword
   balance leastconn
   server web-1 127.0.0.1:xxxx check
   server web-2 xx.xx.xx.xx:xxxx check
sqwale
  • 141
  • 1
  • 8
  • Are you hitting a network or IO limit? – Florin Asăvoaie Jul 19 '14 at 16:44
  • I doubt it because i am sending it the same concurrency and number of requests i would for any single node. Is my configuration correct? – sqwale Jul 21 '14 at 10:59
  • Running haproxy on one of the appservers is not optimal. During your load test, how much idle CPU does the web-1 server retain? – Felix Frank Jul 21 '14 at 11:12
  • I have about 4 cpus running on that machine and about 10GB of RAM. It doesn't seem like that should be the issue. I also added an additional backend and removed the backend running on the same machine as haproxy. Still the same issue, I noticed i achive the best throughput when i only have one backend which doesn't make sense nor is there any point to having such a setup if what i am trying to achieve is load balancing. – sqwale Jul 21 '14 at 11:57
  • That's strange. Somewhere you do have a bottleneck but you need to figure out where it is. We could make a chat and talk more. – Florin Asăvoaie Jul 21 '14 at 13:24

0 Answers0