HAProxy community

Adding New Backend/Frontends without reload

Is there a way to add new front/backend configuration without having to reload the process?

The problem we have is that, we have prometheus scraping our data and in the graphs we see the connections to be zero during the reload, this happens because the reload starts a new process and the stats are reset.

So is there a way to add configs without reloads?

I checked the RunTimeAPI, it has options to add servers to the backend dynamically, but no options to create a new backend as whole.

Also I tried the dataplane api, with that, it reloads the process as do with the systemd once the configuration is done, so no difference here.

I tried the load from state file option, but it only save the backend states, not the number of connections beings served, bytes in/out and other stats.

Is there a way to tell the new process to read the stats from old process which is about to dies? Or is there a way to add configs without reloading the config?

Thanks.

No, it’s not possible the completely reconfigure haproxy without reloading it. Some things can be done, like updating a server IP, but certainly not adding new front and backends.

I suggest you focus on the actual problem instead: Are you using the native haproxy prometheus exporter or some external script to scrap the data?

Hi @lukastribus, yes, we are using the native haproxy prometheus exporter for this purpose. But I am open to explore options if stats can be gathered from old process during the reload !

Thank you !

Personally I don’t know anything about prometheus, but I’d guess that counter overflow are handled in some way or the other, because that’s what happens everywhere, with every software stack and solution. So perhaps it would be a good idea to approach this from the prometheus point of view, which I’m pretty certain, has a solution for this very common problem.