HAProxy 1.8 задерживает http / 2 (h2) запросы с использованием tcp-запроса inspect-delay - PullRequest
0 голосов
/ 02 апреля 2020

Используя HAProxy 1.8, я хочу замедлить определенный трафик c. Это все работает при тестировании через HTTP 1.1. Однако как только http / 2 (h2) будет включен в HAProxy, задержка в 10 секунд больше не будет действовать. Как я могу отложить h2 запросы?

frontend web
  bind [...] alpn h2,http/1.1
  tcp-request inspect-delay 10s
  tcp-request content accept if WAIT_END
  [...]

Я тестирую с помощью curl:

time curl -I 'https://[url]/' -v
*   Trying 10.233.1.97...
* TCP_NODELAY set
* Connected to [url] (10.233.1.97) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
[...]
* ALPN, server accepted to use h2
[...]
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fd3f5808200)
> GET / HTTP/2
> Host: [...]
> User-Agent: curl/7.64.1
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 411
HTTP/2 411
< content-type: text/html; charset=us-ascii
content-type: text/html; charset=us-ascii
< server: Microsoft-HTTPAPI/2.0
server: Microsoft-HTTPAPI/2.0
< date: Thu, 02 Apr 2020 19:18:22 GMT
date: Thu, 02 Apr 2020 19:18:22 GMT
< content-length: 344
content-length: 344

<
* Excess found in a non pipelined read: excess = 344 url = / (zero-length body)
* Connection #0 to host app.cloudbilling.nl left intact
* Closing connection 0
curl -I 'https://[url]/' -v  0.02s user 0.01s system 28% cpu 0.101 total
...