Reference

set maxconn frontend

Change a frontend’s maximum concurrent connections (maxconn) setting.

Description Jump to heading

A frontend section may declare a maxconn setting, which limits the number of concurrent connections the frontend will accept. When this limit is reached, connections queue up in the kernel’s socket queue.

haproxy
frontend fe_main
bind :80
default_backend webservers
maxconn 20000
haproxy
frontend fe_main
bind :80
default_backend webservers
maxconn 20000

Use the set maxconn frontend command to change this limit dynamically. If the limit goes lower than the current number of connections, new connections will queue until they reach the lower threshold.

Examples Jump to heading

Below, we set the frontend fe_main to have a maxconn of 10,000:

nix
echo "set maxconn frontend fe_main 10000" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "set maxconn frontend fe_main 10000" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999

See also Jump to heading

Do you have any suggestions on how we can improve the content of this page?