Hi.

Am 06.12.2018 um 15:20 schrieb flamese...@yahoo.co.jp:
> Hi,
> 
> I have a haproxy(v1.8.14) in front of several nginx backends, everything works
> fine until I add compression in haproxy.

There is a similar thread about this topic.

https://www.mail-archive.com/haproxy@formilux.org/msg31897.html

Can you try to add this option in your config and see if the problem is gone.

option http-pretend-keepalive

Regards
Aleks

> 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 app
> backend 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:8080
> Running 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 read
> Requests/sec:  25476.45
> Transfer/sec:    125.49MB
> 
> 
> 02. Wrk test against haproxy, no filters: everything is OK
> 
> wrk -c 1000 -s a.lua http://10.0.3.15:8000
> Running 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 read
> Requests/sec:  15476.31
> Transfer/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:8000
> Running 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 0
> Requests/sec:  15530.67
> Transfer/sec:     76.14MB
> 
> 04. Wrk test against haproxy, add filter trace, and update flt_trace.c:
> 
> static int
> trace_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 0
> Requests/sec:  15509.93
> Transfer/sec:     76.04MB
> 
> 
> Is there any config error? Am I doing something wrong?
> 
> Thanks
> 


Reply via email to