HAProxy community

Latency introduced when reloading HAP every 15 seconds

We have a use case in which we need to reload HAP every 15 seconds. For every reload, the latency shoots up to 12ms. Normal latency is 7ms at 32k req/s.

Below is what I have tried -

  • On the same host, I started two HAP processes identical to each other with peers config.

The backend/frontends have the same name but listen addresses are different.

Example -

HAP1

frontend test80
    bind 1.1.1.3:80 

HAP2

frontend test80
   bind 1.1.1.4:80  

The actual vip for this frontend is different, I am using iptables to nat the requests to one of the two HAP processes in the same host.

Initial NAT is configured in such a way that every request that comes to the VIP will be sent to the HAP1.

When we need to reload, we will add a new rule to NAT all request to the HAP2’s frontend and remove the old nat rule.

Then we reload the HAP1 as now the requests are being processed by the HAP2 as per the NAT rule.

But we still see the latency during the reload to be same.

Any thoughts on how we can reduce the reload latency will be really helpful.

Thanks