Hi, I’m trying to improve performance of my HAProxy setup, which is currently deployed on Kubernetes.
HAProxy version is 3.0.3-95a607c
No matter what I do, the session rate is not exceeding 3500-4000/s
Currently sending 429 for all requests from frontend because my backend isn’t ready.
I’m making HTTP calls to the proxy using a k6 script with 15,000 VUs
I have only 1 frontend, here’s how it looks like
frontend my_frontend
bind *:80
stick-table type string size 1m expire 1m store http_req_rate(1m)
http-request track-sc0 hdr(Custom-Header)
http-request set-var(req.rate_limit) hdr(Custom-Header),map_str(/etc/haproxy/maps/rate-limit.map,-1)
acl rate_limit_exceeded sc_http_req_rate(0),sub(req.rate_limit) gt 0
http-request deny deny_status 429 if rate_limit_exceeded
default_backend my_backend
option httplog
Here’s my stats page info in middle of a load test:
pid = 8 (process #1, nbproc = 1, nbthread = 24)
uptime = 0d 0h10m11s; warnings = 0
system limits: memmax = unlimited; ulimit-n = 500097
maxsock = 500097; maxconn = 250000; reached = 0; maxpipes = 0
current conns = 15378; current pipes = 0/0; conn rate = 1/sec; bit rate = 7.967 Mbps
Running tasks: 0/15442 (0 niced); idle = 98 %
Max connection rate: 3332/s
Max session rate: 3332/s
Max request rate: 5542/s