[英]Kubernetes Service: IPVS load balancing algorithm
As discovered here , there is a new kind of kube service that are IPVS and have many algorithms for load balancing.正如在这里发现的那样,有一种新型的 kube 服务是 IPVS,并且有许多负载平衡算法。
The only problem is I didn't find where those algorithms are specified.唯一的问题是我没有找到指定这些算法的位置。
My understanding:我的理解:
rr
: round-robin -> call backend pod one after another in a loop rr
: round-robin -> 在循环中一个接一个地调用后端 podlc
: least connection -> group all pod with the lowest number of connection, and send message to it. lc
: least connection -> 将所有连接数最少的 pod 分组,并向其发送消息。 Which kind of connection?哪种连接? only the ones from this service?仅来自此服务的?dh
: destination hashing ->?something based on url? dh
:目标散列->?基于 url 的东西?sh:
source hashing ->?something based on url? sh:
source hashing ->?something based on url?sed
: shortest expected delay -> either the backend with less ping or some logic on the time a backend took to respond in the past sed
:最短的预期延迟-> ping 较少的后端或后端过去响应时间的一些逻辑nq
: never queue -> same as least connection? nq
:从不排队-> 与最少连接相同? but refusing messages at some points?但在某些时候拒绝消息?If anyone has the documentation link (not provided in the official page and still saying IPVS is beta whereas it is stable sync 1.11) or the real algorithm behind all of them, please help.如果有人有文档链接(未在官方页面中提供,但仍然说 IPVS 是测试版,而它是稳定同步 1.11)或所有这些链接背后的真实算法,请提供帮助。
I tried: Google search with the terms + lookup in the official documentation.我试过:在官方文档中使用 terms + lookup 进行谷歌搜索。
They are defined in the code https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/apis/config/types.go#L193它们在代码中定义https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/apis/config/types.go#L193
rr
round robin : distributes jobs equally amongst the available real servers rr
round robin :在可用的真实服务器之间平均分配作业lc
least connection : assigns more jobs to real servers with fewer active jobs lc
least connection :将更多作业分配给活动作业较少的真实服务器sh
source hashing : assigns jobs to servers through looking up a statically assigned hash table by their source IP addresses sh
source hashing :通过源 IP 地址查找静态分配的哈希表,将作业分配给服务器dh
destination hashing : assigns jobs to servers through looking up a statically assigned hash table by their destination IP addresses dh
目标散列:通过按目标 IP 地址查找静态分配的哈希表,将作业分配给服务器sed
shortest expected delay : assigns an incoming job to the server with the shortest expected delay. sed
最短预期延迟:将传入作业分配给具有最短预期延迟的服务器。 The expected delay that the job will experience is (Ci + 1) / Ui if sent to the ith server, in which Ci is the number of jobs on the ith server and Ui is the fixed service rate (weight) of the ith server.如果发送到第 i 个服务器,作业将经历的预期延迟是 (Ci + 1) / Ui,其中 Ci 是第 i 个服务器上的作业数,Ui 是第 i 个服务器的固定服务速率(权重)。nq
never queue : assigns an incoming job to an idle server if there is, instead of waiting for a fast one; nq
never queue :如果有空闲服务器,则将传入作业分配给空闲服务器,而不是等待快速作业; if all the servers are busy, it adopts the ShortestExpectedDelay policy to assign the job.如果所有服务器都忙,则采用 ShortestExpectedDelay 策略分配作业。All those come from IPVS official documentation: http://www.linuxvirtualserver.org/docs/scheduling.html以上均来自IPVS官方文档: http ://www.linuxvirtualserver.org/docs/scheduling.html
Regards问候
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.