@acook wrote:
Hello,
I'm using HAProxy to front a simple node application, using the following acl/backend configuration:
acl acl_myapp hdr(host) -i myapp.service.consul use_backend backend_myapp if acl_myapp backend backend_myapp balance roundrobin option httpchk GET /health server 10.134.20.234_31005 10.134.20.234:31005 maxconn 128 weight 100 checkI am running an ApacheBench test against the application to test the max requests/sec I can achieve with my app. I am running
abwith 300 concurrent requests, and a total of 6000 requests.When I run
abagainst my application directly, on port31005, for example:
ab -n 6000 -c 300 -k "http://10.134.20.234:31005/"I see numbers like
Requests per second: 1053.19 [#/sec] (mean) Requests per second: 1104.31 [#/sec] (mean) Requests per second: 1069.48 [#/sec] (mean)However, when I go via HAProxy via setting host header, i.e.
ab -H "Host: myapp.service.consul" -n 6000 -c 300 -k "http://10.134.20.234/"I see numbers like
Requests per second: 699.89 [#/sec] (mean) Requests per second: 752.43 [#/sec] (mean) Requests per second: 747.10 [#/sec] (mean)Which is around
300 req/secworse than when going direct to the application.When I look at the statistics using
maxconnof128, I see:Queue time: 269 ms Response time: 198 ms Total time: 467 msIf I change it to something really high, like
1000, I see:Queue time: 0 ms Response time: 418 ms Total time: 418 msAnd if change the
maxconnto something low like30, I see:Queue time: 311 ms Response time: 41 ms Total time: 386 msAny ideas why I'm seeing such a difference when going through HAProxy?
Posts: 7
Participants: 2