unimib-datAI / dfaas

Decentralized FaaS platform
17 stars 3 forks source link

Loss of requests when HAProxy is reloaded #8

Open ema-pe opened 3 days ago

ema-pe commented 3 days ago

When the DFaaS agent recalculates the weights and updates the HAProxy configuration by reloading HAProxy (the actual command is shown below from the stecattaneo-dev branch), the open connections will be closed and new requests will be rejected until HAProxy is fully reloaded.

https://github.com/unimib-datAI/dfaas/blob/de1f6fb88dc836f4f0dce1b856c7760a2207936e/dfaasagent.env#L23

You can see this in the plots of requests and cumulative errors (this example is the figlet-light-350 test with the node margin strategy using the container environment): the small spikes occur when HAProxy is reloaded.

plot-nodes-responses-and-cumulatives

One solution may be to rewrite how HAProxy is reloaded, taking advantage of the HAProxy hitless reload feature (starting from 1.8 version). More info here: https://www.haproxy.com/blog/hitless-reloads-with-haproxy-howto