Computer Science/Network
Load Balancer
JTB
2025. 7. 25. 22:55
A load balancer is a device or software that distributes incoming client requests across multiple backend servers, with the goal of increasing the system’s capacity and reliability.
- It helps handle high volumes of traffic by distributing requests based on factors such as URL paths, server availability, cache state, and cookies.
- Many load balancers also include security features such as filtering out malicious traffic or unnecessary external data.
- They can also monitor application-level traffic for performance and availability.
If a server becomes unresponsive or fails, the load balancer automatically removes it from the pool of active servers.
This is done using a mechanism called a health check.
Health Check
A health check is a routine process that checks whether a server or service is functioning correctly.
- It involves sending periodic requests (e.g., to /health, /ping) at defined intervals.
- Parameters such as interval and retry attempts can be configured to determine when a server should be marked as unhealthy.
- For example, if a TCP connection fails to complete the 3-way handshake, the load balancer will treat the server as unhealthy and stop routing traffic to it.
Redundancy and High Availability
Load balancers often enable server redundancy by operating across two or more servers.
They can assign a virtual IP address that maps to multiple physical servers.
Even if one server fails, the service remains operational and stable, ensuring high availability for users.