LVS的10中调度算法

简介:

LVS中的可以分成静态和动态两种算法,而每种算法下面还有其他算法:


四种静态:

rr

wrr

dh

sh


四种动态:

lc: 最少连接。

如何计算哪个连接多哪个连接少呢?

计算当前后端每一个realserver的活动连接数和非活动连接数的总数并进行比较,哪一个数目小,则选择哪一个。

active*256+inactive(谁的数量小,那么选择)。

wlc:加权最少连接。

比较方法:active*256+inactive / weight,谁的数字小,选择。

sed:最短期望延迟(对wlc改进的算法),权重大优先被选择。

算法: (active+1)*256 / weight

nq: never queue,从不排队(sed的改进)。每个动发一个,然后再计算。

lblc:基于本地的最少连接。

考虑cache的连接数

缺点:游客能破坏命中率。

lblcr:基于本地带复制功能的最少连接。


lvs默认算法:wlc





What's the lvs?


Linux virtual server is the high available and high scalable server built on a cluster server, with the load balancedr running on the Linux opearting system.


there are 10 schedulers. the schedulers are rr, wrr, lc, wlc, lblc, lblcr, dh, sh.


I just looked at them. I need write them on my blog so that looking in the future.


Round Robin(rr), Weighted round robin(wrr) - new connections are assigned to each realserver in turn.


different: the server's load will have been detection and adjust dynamic by wrr schedulers. rr will not adjust.


Least connections(lc), Weighted least connections(wlc) - new connections come to realserver with the least number of connections.


different:same the rr and wrr


Locality-based least connections (lblc), Locality-based least with replication(lblcr)

The LBLC code (by Wensong) and the DH scheduler (by Wensong, inspired by code submitted by Thomas Proellproellt (at) gmx (dot) de) are designed for web caching realservers (e.g. squids). For normal LVS services (eg ftp, http), the content offered by each realserver is the same and it doesn't matter which realserver the client is connected to. For a web cache, after the first fetch has been made, the web caches have different content. As more pages are fetched, the contents of the web caches will diverge. Since the web caches will be setup as peers, they can communicate by ICP (internet caching protocol) to find the cache(s) with the required page. This is faster than fetching the page from the original webserver. However, it would be better after the first fetch of a page from http://www.foo.com/*, for all subsequent clients wanting a page from http://www.foo.com/ to be connected to that realserver.


different:用于cache集群系统,两者一个是服务器,一个是服务器群。


Destination Hashing(DH), Source Hashing(SH)


The DH scheduler can keep the two load balancer redirect requests destined for the same IP address to the same cache server. If the server is dead or overloaded, the load balancer can use cache_bypass feature to send requests to the original server directly. (Make sure that the cache servers are added in the two load balancers in the same order)










本文转自 安安安安森  51CTO博客,原文链接:http://blog.51cto.com/smallc/1213461,如需转载请自行联系原作者
相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
目录
相关文章
|
6月前
|
机器学习/深度学习 算法 调度
基于NSGA-III算法求解微电网多目标优化调度研究(Matlab代码实现)
基于NSGA-III算法求解微电网多目标优化调度研究(Matlab代码实现)
253 3
|
6月前
|
机器学习/深度学习 运维 算法
基于非支配排序遗传算法NSGAII的综合能源优化调度(Matlab代码实现)
基于非支配排序遗传算法NSGAII的综合能源优化调度(Matlab代码实现)
374 0
基于非支配排序遗传算法NSGAII的综合能源优化调度(Matlab代码实现)
|
6月前
|
机器学习/深度学习 边缘计算 监控
【创新】【微电网多目标优化调度】五种多目标优化算法(MOJS、NSGA3、MOGWO、NSWOA、MOPSO)求解微电网多目标优化调度(Matlab代码实现)
【创新】【微电网多目标优化调度】五种多目标优化算法(MOJS、NSGA3、MOGWO、NSWOA、MOPSO)求解微电网多目标优化调度(Matlab代码实现)
529 0
|
6月前
|
机器学习/深度学习 算法 安全
【微电网】【创新点】基于非支配排序的蜣螂优化算法NSDBO求解微电网多目标优化调度研究(Matlab代码实现)
【微电网】【创新点】基于非支配排序的蜣螂优化算法NSDBO求解微电网多目标优化调度研究(Matlab代码实现)
212 0
|
6月前
|
机器学习/深度学习 运维 算法
【微电网多目标优化调度】多目标学习者行为优化算法MOLPB求解微电网多目标优化调度研究(Matlab代码实现)
【微电网多目标优化调度】多目标学习者行为优化算法MOLPB求解微电网多目标优化调度研究(Matlab代码实现)
314 1
|
6月前
|
机器学习/深度学习 存储 算法
【微电网优化调度】五种多目标优化算法(MOPSO、MOAHA、NSGA2、NSGA3、MOGWO)求解微电网多目标优化调度比较研究【创新未发表】(Matlab代码实现)
【微电网优化调度】五种多目标优化算法(MOPSO、MOAHA、NSGA2、NSGA3、MOGWO)求解微电网多目标优化调度比较研究【创新未发表】(Matlab代码实现)
315 8
|
6月前
|
运维 算法 搜索推荐
基于天牛须(BAS)与NSGA-Ⅱ混合算法的交直流混合微电网多场景多目标优化调度(Matlab代码实现)
基于天牛须(BAS)与NSGA-Ⅱ混合算法的交直流混合微电网多场景多目标优化调度(Matlab代码实现)
333 1
|
6月前
|
机器学习/深度学习 边缘计算 分布式计算
基于差分进化算法的微电网调度研究(Matlab代码实现)
基于差分进化算法的微电网调度研究(Matlab代码实现)
240 1
|
6月前
|
存储 机器学习/深度学习 运维
基于改进灰狼算法的并网交流微电网经济优化调度研究(Matlab代码实现)
基于改进灰狼算法的并网交流微电网经济优化调度研究(Matlab代码实现)
120 1
|
6月前
|
机器学习/深度学习 存储 算法
【微电网调度】考虑需求响应的基于改进多目标灰狼算法的微电网优化调度研究(Matlab代码实现)
【微电网调度】考虑需求响应的基于改进多目标灰狼算法的微电网优化调度研究(Matlab代码实现)
285 0