I’ve set up a simple haproxy to do load balancing between my servers. Here’s part of the haproxy.conf:
listen my_app mode http bind :9010 balance roundrobin option forwardfor log global option httplog option httpchk GET /crowdtest/health timeout check 10s cookie BEC insert indirect nocache maxlife 120s maxconn 20480 timeout server 30s timeout client 30s server my_backend 10.17.11.219:80 cookie 4D49D4F check inter 10s rise 3 fall 3 weight 100 port 80
Everything works fine when my_backend sends files with static content length. However when my_backend sends 2 chunks of data using chunked transfer-encoding (the first chunk sent, 5s later send the second), haproxy adds about 500ms latency. Is haproxy waiting for my_backend to send the whole response so that it will begin to forward response?