Load Balancing
Load balancing is the strategic distribution of network traffic across multiple servers or resources to optimize performance, enhance reliability, and ensure hi...
Load balancing은 분산 시스템 및 네트워크 아키텍처에서 여러 백엔드 서버 또는 리소스에 걸쳐 들어오는 네트워크 트래픽을 분배하는 기본적인 기술입니다. 주요 목표는 리소스 활용도를 최적화하고, 처리량을 최대화하며, 응답 시간을 최소화하고, 단일 리소스의 과부하를 방지하는 것입니다. Load balancer는 OSI 모델의 다양한 계층에서 작동하며, Layer 4 (Transport Layer)와 Layer 7 (Application Layer)이 가장 일반적입니다. Layer 4 load balancer는 일반적으로 IP 주소와 포트 번호를 기반으로 라우팅 결정을 내리며, 높은 성능과 단순성을 제공합니다. 반면에 Layer 7 load balancer는 트래픽의 콘텐츠(예: HTTP 헤더, URL)를 검사하여 더 지능적인 라우팅 결정을 내릴 수 있으며, SSL termination, content-based routing, session persistence와 같은 기능을 가능하게 합니다. 일반적인 알고리즘에는 요청을 순차적으로 분배하는 Round Robin, 가장 적은 활성 연결을 가진 서버로 트래픽을 보내는 Least Connections, 동일한 클라이언트의 요청이 일관되게 동일한 서버로 가도록 클라이언트 IP 주소의 해시를 사용하는 IP Hash가 포함됩니다. 고급 기술에는 비정상적인 서버를 감지하고 풀에서 제거하여 고가용성 및 내결함성을 보장하는 health check가 포함됩니다. Trade-off에는 복잡성, 비용, 그리고 load balancer 자체가 이중화되지 않은 경우 잠재적인 single point of failure가 포함됩니다.
graph LR
Center["Load Balancing"]:::main
Rel_advanced_propulsion_systems["advanced-propulsion-systems"]:::related -.-> Center
click Rel_advanced_propulsion_systems "/terms/advanced-propulsion-systems"
Rel_content_delivery_network["content-delivery-network"]:::related -.-> Center
click Rel_content_delivery_network "/terms/content-delivery-network"
Rel_distributed_systems["distributed-systems"]:::related -.-> Center
click Rel_distributed_systems "/terms/distributed-systems"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 5살도 이해할 수 있게 설명
손님이 많은 인기 있는 식당을 상상해 보세요. Load balancing은 새로운 손님을 가장 적은 테이블을 맡고 있는 웨이터에게 안내하는 호스트와 같아서, 모든 사람이 음식을 더 빨리 받고 어떤 웨이터도 과부하되지 않도록 합니다.
🤓 Expert Deep Dive
로드 밸런싱은 단일 실패 지점을 방지하고 리소스 활용을 효과적으로 관리함으로써 성능을 최적화하고 안정성을 향상시키며 높은 가용성을 보장하기 위해 네트워크 트래픽을 여러 서버 또는 리소스에 전략적으로 분산하는 것입니다.