L7 load balancers are a fundamental building block in microservices as they enable fine-grained traffic distribution. Compared to monolithic applications, microservices demand higher performance and stricter isolation from load balancers. This is due to the increased number of instances, longer service chains, and the necessity for co-location with services on the same host. Traditional sidecar-based load balancers are ill-equipped to meet these demands, often resulting in significant performance degradation. In this work, we present XLB, a novel architecture that reshapes L7 load balancers as in-kernel interposition operating on the socket layer. We leverage eBPF to implement the core load balancing logic in the kernel, and address the connection management and state maintenance challenges through novel socket layer redirection and nested eBPF maps designs. XLB eliminates the extra overhead of scheduling, communication, and data movement, resulting in a more lightweight, scalable, and efficient L7 load balancer architecture. Compared to the widely used microservices load balancers (Istio and Cilium), over 50 microservice instances, XLB achieves up to 1.5x higher throughput and 60% lower end-to-end latency.
翻译:七层负载均衡器是微服务架构中的基础组件,能够实现细粒度的流量分发。与单体应用相比,微服务对负载均衡器提出了更高的性能要求和更严格的隔离需求,这源于其实例数量增多、服务链更长,且需要与同主机上的服务共置。传统的基于边车模式的负载均衡器难以满足这些需求,通常会导致显著的性能下降。本文提出XLB,一种新颖的架构,将七层负载均衡器重塑为在套接字层运行的内核拦截机制。我们利用eBPF在内核中实现核心负载均衡逻辑,并通过创新的套接字层重定向和嵌套eBPF映射设计,解决了连接管理与状态维护的挑战。XLB消除了调度、通信和数据移动的额外开销,从而构建出更轻量、可扩展且高效的七层负载均衡器架构。与广泛使用的微服务负载均衡器(Istio和Cilium)相比,在超过50个微服务实例的场景下,XLB实现了高达1.5倍的吞吐量提升和60%的端到端延迟降低。