Load balancer (Networking)
Load balancing across multiple application instances is a commonly used technique for optimizing resource utilization, maximizing throughput, reducing latency, and ensuring fault‑tolerant configurations.
Load balancing in Nginx is configured using upstream
directive.[1].
- Supported load balancing algorithms: Round Robin, Least Connections, IP Hash, Generic Hash, Least Time (Nginx Plus), Random
- Sticky methods (NGINX Plus): Sticky cookie, Sticky route (NGINX Plus), Sticky learn
Network load balancer can provide service for different protocols, such as TCP, UDP, HTTP or HTTPS.
Typical options:
- Listening port
- FQDN
- Protocol: TCP, UDP, HTTP, HTTPS, Websockets
- Destination servers and destination port
- Load Balancing algorithm: WRR, weighted least connection, source IP hash
- Sticky session
Nginx configuration example
upstream backend { # no load balancing method is specified for Round Robin. Other options: least_conn, ip_hash, least_time header, random two least_time=last_byte server backend1.example.com slow_start=30s; server backend2.example.com max_conns=3; server backend3.example.com; server 192.0.0.1 backup; }
Related terms
See also
- HTTP, HTTP client, HTTP/1.1, HTTP/2, HTTP/3, HTTPS, HSTS CSR, TLS, SSL,
openSSL
, WebSockets, WebRTC,ssl_certificate
QUIC, HPKP, CT, List of HTTP status codes, URL redirection, Content-type:, Webhook, HTTP headers,--insecure
, Axios HTTP client, HTTP cookies, HTTP ETag, Hypertext Transfer Protocol -- HTTP/1.1 - Proxy servers:
Squid
, Reverse proxy,Nginx
,HAProxy
,Varnish
, Load balancer, Load Balancer as a Service (LBaaS), Symantec proxySG and Advanced Secure Gateway (ASG), Traefik, tinyproxy, Proxyrack, Luminati Networks, SOCKS, Envoy Proxy - Traefik
Advertising: