I have 4 web servers with a ruby web server running, and a server running haproxy.

I can get a RPS(request per second) of 300 against one web server using ab.

But I can only get a RPS of 340 against haproxy server.

The simple sample ruby app just provides one API that fetch certain ID from mysql and return to client.

And here's my haproxy conf

    log local2
    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     100000
    user        haproxy
    group       haproxy
    log                     global
    maxconn                 1000000
frontend api
    bind *:8080
    mode http
    use_backend web
backend web
    balance     roundrobin
    mode http

Any suggestions would be appreciated

  • What numbers do you get when you run ab against an individual ruby server? – Aaron Jun 27 '17 at 3:27
  • I can get a RPS(request per second) of 300 against one web server using ab. – Sato Jun 27 '17 at 3:30
  • Have you tried running 4 instances of ab, or 4 instances of ab from 4 different IP's in front of haproxy? Likely just one instance would utilize keep-alive and stay on one backend node. Are you seeing equal distribution in the web console? – Aaron Jun 27 '17 at 3:32
  • 1
    What value are you using for concurrency with ab? (-c)? The numbers are pretty much meaningless unless this is set to at least the number of back-ends. Default is 1. Even your single server test result lacks meaning until you understand the impact of concurrent requests. – Michael - sqlbot Jun 27 '17 at 5:11
  • @Aaron I tried ab to 4 web servers at the same time, all gives a qps around 300 – Sato Jun 27 '17 at 5:37

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.