Load balancer
A load balancer is a piece of network infrastructure that distributes incoming traffic across multiple servers running the same service. Its purpose is to prevent any single machine from being overwhelmed and to keep an application fast and continuously available.
How a load balancer works
A load balancer sits at the entrance to a group of servers (the backend pool) and, for each request, decides which machine to send it to. That decision is driven by a balancing algorithm. The most common are: round robin (handing requests to servers in turn), least connections (to the server with the fewest active connections) and weighted variants that account for differing server capacity. A key function is health checks — the load balancer regularly probes server availability and automatically removes unresponsive nodes from rotation, routing traffic only to healthy ones.
Load balancers are distinguished into Layer 4 (transport, operating on IPs and ports) and Layer 7 (application, inspecting HTTP request content). The latter can route by URL path or headers and often double as a reverse proxy.
Practical application
Load balancing is a cornerstone of high-availability architectures. Spreading traffic across several servers not only handles more load but also survives the failure of a single machine without service interruption. A load balancer also enables horizontal scaling — adding more servers to a cluster as demand grows — and zero-downtime deployments, where nodes being updated are drained from rotation one at a time. This role is filled by dedicated appliances and cloud services as well as software such as Nginx or HAProxy.
Powiązane pojęcia
Najczęstsze pytania
What is the difference between an L4 and an L7 load balancer?
A Layer 4 (transport) load balancer distributes traffic based on IP addresses and ports without inspecting request content — it is fast and lightweight. Layer 7 (application) inspects HTTP request content, so it can route by URL path, headers or cookies, at the cost of more overhead.
