Reference

set rate-limit connections global

Set the process-wide connection rate limit.

Description Jump to heading

You can limit the rate at which the load balancer accepts new connections by setting the global setting maxconnrate. In the snippet below, 1,000 connections per second are allowed:

haproxy
global
maxconnrate 1000
haproxy
global
maxconnrate 1000

Note that this limit is process-wide, so it is possible for one frontend to consume the majority of the capacity. However, you can also set a per-frontend limit with either the rate-limit sessions directive or with a stick table.

Use the set rate-limit connections global command to change the global maxconnrate setting dynamically.

Examples Jump to heading

Below, we set the global connection rate limit to 5,000 connections per second:

bash
echo "set rate-limit connections global 5000" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
bash
echo "set rate-limit connections global 5000" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999

See also Jump to heading

If this page was useful, please, Leave the feedback.

© 2023 HAProxy Technologies, LLC. All Rights Reserved
Manage Cookie Preferences