Hi, p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; min-height: 14.0px}I have a haproxy(v1.8.14) in front of several nginx backends, everything works fine until I add compression in haproxy. My config looks like this: ### Config start #####global maxconn 1000000 daemon nbproc 2 defaults retries 3 option redispatch timeout client 60s timeout connect 60s timeout server 60s timeout http-request 60s timeout http-keep-alive 60s frontend web bind *:8000 mode http default_backend appbackend app mode http #filter compression #filter trace server nginx01 10.0.3.15:8080### Config end #####
Lua script used in wrk:a.lua: local count = 0 request = function() local url = "/?count=" .. count count = count + 1 return wrk.format( 'GET', url )end 01. wrk test against nginx: everything if OK wrk -c 1000 -s a.lua http://10.0.3.15:8080Running 10s test @ http://10.0.3.15:8080 2 threads and 1000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 34.83ms 17.50ms 260.52ms 76.48% Req/Sec 12.85k 2.12k 17.20k 62.63% 255603 requests in 10.03s, 1.23GB readRequests/sec: 25476.45Transfer/sec: 125.49MB 02. Wrk test against haproxy, no filters: everything is OK wrk -c 1000 -s a.lua http://10.0.3.15:8000Running 10s test @ http://10.0.3.15:8000 2 threads and 1000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 73.58ms 109.48ms 1.33s 97.39% Req/Sec 7.83k 1.42k 11.95k 66.15% 155843 requests in 10.07s, 764.07MB readRequests/sec: 15476.31Transfer/sec: 75.88MB 03. Wrk test against haproxy, add filter compression: read error Change #filter compression===> filter compression wrk -c 1000 -s a.lua http://10.0.3.15:8000Running 10s test @ http://10.0.3.15:8000 2 threads and 1000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 60.43ms 42.63ms 1.06s 91.54% Req/Sec 7.86k 1.40k 10.65k 67.54% 157025 requests in 10.11s, 769.87MB read Socket errors: connect 0, read 20, write 0, timeout 0Requests/sec: 15530.67Transfer/sec: 76.14MB 04. Wrk test against haproxy, add filter trace, and update flt_trace.c: static inttrace_attach(struct stream *s, struct filter *filter){ struct trace_config *conf = FLT_CONF(filter); // add below // ignore this filter to avoid performance down since there are many print return 0; And change #filter compression #filter trace===> #filter compression filter trace Running 10s test @ http://10.0.3.15:8000 2 threads and 1000 connections Thread Stats Avg Stdev Max +/- Stdev Latency 64.88ms 77.91ms 1.09s 98.26% Req/Sec 7.84k 1.47k 11.57k 67.71% 155800 requests in 10.05s, 763.86MB read Socket errors: connect 0, read 21, write 0, timeout 0Requests/sec: 15509.93Transfer/sec: 76.04MB Is there any config error? Am I doing something wrong? Thanks