# Latency added when backend emits response every few seconds

**URL:** https://discourse.haproxy.org/t/latency-added-when-backend-emits-response-every-few-seconds/855
**Category:** Help!
**Created:** [December 15, 2016, 5:07am UTC](https://discourse.haproxy.org/t/latency-added-when-backend-emits-response-every-few-seconds/855 "2016-12-15T05:07:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![old\_bear](https://avatars.discourse-cdn.com/v4/letter/o/4da419/32.png) [@old\_bear](https://discourse.haproxy.org/u/old_bear)
#### Post date: [December 15, 2016, 5:07am UTC](https://discourse.haproxy.org/t/latency-added-when-backend-emits-response-every-few-seconds/855/1 "2016-12-15T05:07:18Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [December 15, 2016, 9:48am UTC](https://discourse.haproxy.org/t/latency-added-when-backend-emits-response-every-few-seconds/855/2 "2016-12-15T09:48:39Z")

</div>

Exactly what haproxy release are you running? Can you provide the output of haproxy -vv?

If you want to sacrifice performance for latency, you can set option http-no-delay:  
[http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4.2-option%20http-no-delay](http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4.2-option%20http-no-delay)

---

<div class="post-metadata">

### Author: ![old\_bear](https://avatars.discourse-cdn.com/v4/letter/o/4da419/32.png) [@old\_bear](https://discourse.haproxy.org/u/old_bear)
#### Post date: [December 15, 2016, 10:09am UTC](https://discourse.haproxy.org/t/latency-added-when-backend-emits-response-every-few-seconds/855/3 "2016-12-15T10:09:27Z")

</div>

Thanks a lot! I’m using haproxy 1.5.3. I looked up http-no-delay in the documentation and I think that’s the cause.

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [December 15, 2016, 10:15am UTC](https://discourse.haproxy.org/t/latency-added-when-backend-emits-response-every-few-seconds/855/4 "2016-12-15T10:15:14Z")

</div>

It could also be a bug though.

Upgrade to a current stable release to make sure.
