At WoltLab, we bill customers of our SaaS offering based on resource usage, which requires meticulous tracking of any request being processed. Although it appeared to be an easy task at first glance, we quickly realized that there is no simple solution that ticks all the boxes: accuracy, reliability, and zero impact on request processing. That was true until we came across HAProxy’s “Peers” feature, which allows HAProxy servers to sync data amongst themselves.
In this presentation, I will demonstrate the hidden powers of the Peers feature as it has enabled us to connect our HAProxy load balancers to a custom management system that passively receives all stick table updates and accumulates them for billing purposes. I’ll explain how we identify different types of requests using ACLs, how we count them using stick tables, and where the magic happens in our management application. We have open-sourced our Peers Protocol implementation, which is written in TypeScript.
Here you can view the slides used in this presentation if you’d like a quick overview of what was shown during the talk.