《任玉鑫--基于eBPF的应用层负载均衡的优化实践与探索.pdf》由会员分享,可在线阅读,更多相关《任玉鑫--基于eBPF的应用层负载均衡的优化实践与探索.pdf(16页珍藏版)》请在三个皮匠报告上搜索。
1、基于eBPF的应用层负载均衡的优化实践与探索第二届 eBPF开发者大会w w w.e b p f t r a v e l.c o m中 国 西 安任 玉 鑫 华 为Background:micro-serviceCharacteristics Long service chain Layer-7 load balancing Load balancer co-locationBackground:L7 load balancing Nginx、HAProxy、Envoy Load distribution Application awareness High performance requi
2、rementBackground:current practiceProxy-based solution:more hops,redundant processingIstioCiliumBackground:current practiceSecurity,Isolation,Compatibility issueLibraryDPDKProblem summaryComponentsSidecar ProxyProtocol parsing4.5us(5.11%)Load balancing13us(14.78%)Connection splicing22us(25%)Socket pr
3、ocessing3.83us(4.35%)Kernel protocol26.9us(30.62%)Others17.7us(20.12%)SidecarKernel BypassLibraryDuplicated ProcessingHighHighLowSystem CallsHighLowHighCross-processHighHighLowIsolationHighHighLowCompatibilityHighLowLowOverhead breakdownApproach comparisonDesign:architectureGoals Near-zero unnecessa
4、ry overhead Service isolation and security Operational compatibilityeBPFDesign:benefits Intercept complete message contents Fast message process Flexible message rewriting Modular extensionDesign:challenges Challenge 1:insufficient and inflexible connection management in the kernel.Challenge 2:compl
5、ex application layer states maintenance in the kernel.Design:eBPF Interpositionimplements backend selection in eBPF to execute in the kernel Packet parsing:extract packet contents Service location:combine message contents with IP Routing:match requests with routing rules sequentially,and the last ma
6、tched rule resolves the destination service Instance selection:conventional loading balancing algorithms,such as round-robin,random,and the least requestDesign:socket redirection New socket types Connection pool Request mapEvaluation:Scalab