0

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

global
    log         127.0.0.1 local2
    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     100000
    user        haproxy
    group       haproxy
    daemon
defaults
    log                     global
    maxconn                 1000000
frontend api
    bind *:8080
    mode http
    use_backend web
backend web
    balance     roundrobin
    mode http
    server 10.0.1.100:8080
    server 10.0.1.101:8080
    server 10.0.1.102:8080
    server 10.0.1.103:8080

Any suggestions would be appreciated

Sato
  • 449
  • 2
  • 9
  • 17
  • What numbers do you get when you run `ab` against an individual ruby server? – Aaron Jun 27 '17 at 03:27
  • I can get a RPS(request per second) of 300 against one web server using ab. – Sato Jun 27 '17 at 03: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 03: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 05:11
  • @Aaron I tried ab to 4 web servers at the same time, all gives a qps around 300 – Sato Jun 27 '17 at 05:37
  • @Michael-sqlbot its `-c 10` – Sato Jun 27 '17 at 05:38

0 Answers0