负载均衡将传入请求分发到多个服务器——实现水平扩展,提高可用性,并防止任何单个服务器被压垮。它是可扩展、可靠系统的基础组件。
负载均衡器的作用
text
A LOAD BALANCER sits in front of multiple servers and distributes requests among them:
Client → LOAD BALANCER → ┬→ Server 1
├→ Server 2
└→ Server 3
→ spreads load → no single server is overwhelmed (enables HORIZONTAL scaling)
→ routes around FAILED servers (health checks) → high AVAILABILITY
→ a single entry point for clients
负载均衡很重要的原因
text
✓ SCALABILITY → distributes load across many servers → handle more traffic by adding servers
✓ AVAILABILITY → if a server fails, route to healthy ones → no single point of failure
✓ PERFORMANCE → prevents any server from being overloaded → consistent response times
✓ Enables ZERO-DOWNTIME deploys, maintenance (take servers out of rotation)
→ a foundation of scalable, highly-available systems.
