Haproxy 是一个功能强大的负载均衡工具。我这里把它当流量转发工具使用。
相比 iptables
,haproxy可以吃到 bbr
的加速。
apt install haproxy
systemctl enable haproxy
rm -rf /etc/haproxy/haproxy.cfg
nano /etc/haproxy/haproxy.cfg
global
ulimit-n 51200
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
user haproxy
group haproxy
daemon
defaults
log global
mode tcp
option dontlognull
timeout connect 600
timeout client 5m
timeout server 5m
frontend to-webhosting24-de
bind *:23333
default_backend webhosting24-de
backend webhosting24-de
server server1 1.1.1.1:443 maxconn 204800
重启生效:systemctl restart haproxy