# Extract RPS per backend from HAProxy logs (simplified) awk 'print $NF' /var/log/haproxy.log | sort | uniq -c | \ awk 'print "log10_loadshare=" log($1+1)/log(10) " raw=" $1'
Use inverse of average latency as the metric. If Server A has 5 ms latency and Server B has 50 ms latency, linear would strongly favor A. Log10 compresses this difference, preventing all traffic from rushing to the slightly faster server (which might then degrade under load). log10 loadshare
# Example: nodes with raw capacity weights capacities = [1000, 100, 10, 1] shares = log10_loadshare(capacities) # Extract RPS per backend from HAProxy logs