# Docker only lags 5% in performance while paired with HAProxy makes our bidders 50% slower, any clue why?

**URL:** <https://discourse.haproxy.org/t/docker-only-lags-5-in-performance-while-paired-with-haproxy-makes-our-bidders-50-slower-any-clue-why/2679>\
**Category:** Help!\
**Created:** [July 1, 2018, 1:45am UTC](https://discourse.haproxy.org/t/docker-only-lags-5-in-performance-while-paired-with-haproxy-makes-our-bidders-50-slower-any-clue-why/2679 "2018-07-01T01:45:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanilla\_rtb](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vanilla\_rtb](https://discourse.haproxy.org/u/vanilla_rtb)\
**Post date:** [July 1, 2018, 1:45am UTC](https://discourse.haproxy.org/t/docker-only-lags-5-in-performance-while-paired-with-haproxy-makes-our-bidders-50-slower-any-clue-why/2679/1 "2018-07-01T01:45:57Z")

</div>

> **[venediktov/vanilla-rtb](https://github.com/venediktov/vanilla-rtb/tree/master/docker_swarm)**
>
> Real Time Bidding (RTB) - Demand Side Platform framework - venediktov/vanilla-rtb

More details besides README on GitHub. Our bidders use persistent connections, we configured HAProxy to use **http-keep-alive** , without **http-keep-alive** it runs even slower. We **disabled docker mesh routing** and added HAProxy due to mesh dropping connections to our bidders . Btw, **Traefik** proxy runs even slower then **HAProxy**. Here are the numbers on my machine

- **22K QPS** single bidder response outside of docker

- **20K QPS** single bidder response in docker

- **5K QPS** with **HAProxy** + 1 bidder in docker , **HAProxy** is part of swarm but mesh routing to **HAProxy** is disabled

- **2.5K QPS** with **Traefik** proxy with 1 bidder behind proxy , swarm mesh is disabled , sticky session in traefik enabled

Tested **HAProxy** outside of docker talking directly to bidder running outside of docker too - **7K QPS**

**QPS** - Queries Per Second

The main question is **http-keep-alive** is it for both connections to HAProxy and backend sockets where HAProxy re-routes requests ? If **http-keep-alive** is only for the front-end then I guess I know why it’s so slow .
