Přeskočit na obsah
_CORE
AI & Agentic Systems Core Informační Systémy Cloud & Platform Engineering Data Platforma & Integrace Security & Compliance QA, Testing & Observability IoT, Automatizace & Robotika Mobile & Digital Banky & Finance Pojišťovnictví Veřejná správa Obrana & Bezpečnost Zdravotnictví Energetika & Utility Telco & Média Průmysl & Výroba Logistika & E-commerce Retail & Loyalty
Reference Technologie Blog Knowledge Base O nás Spolupráce Kariéra
Pojďme to probrat

HAProxy tutorial

01. 01. 2024 1 min čtení intermediate

HAProxy je nejrozšířenější open-source load balancer.

Instalace

sudo apt install haproxy sudo systemctl enable –now haproxy

Konfigurace

global maxconn 50000 defaults mode http timeout connect 5s timeout client 30s timeout server 30s frontend web bind *:80 bind *:443 ssl crt /etc/ssl/site.pem redirect scheme https if !{ ssl_fc } default_backend servers backend servers balance roundrobin option httpchk GET /health server web1 10.0.1.1:3000 check server web2 10.0.1.2:3000 check server web3 10.0.1.3:3000 check backup

Stats

listen stats bind *:8404 stats enable stats uri /stats

  • ACL routing — URL, headers, cookies
  • Rate limiting — stick tables
  • Connection draining — graceful shutdown
  • SSL termination

HAProxy = spolehlivost

Battle-tested load balancer pro produkci.

haproxyload balancingha