分类: LINUX
2011-05-17 17:57:05
man ipvsadm
-s, --scheduler scheduling-method
scheduling-method Algorithm for allocating TCP connections and
UDP datagrams to real servers. Scheduling algorithms are imple-
mented as kernel modules. Ten are shipped with the Linux Virtual
Server:
rr - Robin Robin: distributes jobs equally amongst the available
real servers.
轮叫调度(Round Robin Scheduling)
• 该算法就是以轮叫的方式依次将请求调度不同的服务器,即每次调度执行
i = (i + 1) mod n,并选出第i台服务器。算法的优点是其简洁性,它无
需记录当前所有连接的状态,所以它是一种无状态调度。
• 在系统实现时,我们引入了一个额外条件,当服务器的权值为零时,表示该服务器不可用而不被调度。
• 轮叫调度算法假设所有服务器处理性能均相同,不管服务器的当前连接数和响应速度。
• 与Round-Robin DNS方法比较。
wrr - Weighted Round Robin: assigns jobs to real servers propor-
tionally to there real servers’ weight. Servers with higher
weights receive new jobs first and get more jobs than servers
with lower weights. Servers with equal weights get an equal dis-
tribution of new jobs.
加权轮叫调度(Weighted Round-Robin Scheduling)
• 加权轮叫调度算法假设所有服务器处理性能不相同,不管服务器的当前连接数和响应速度。
lc - Least-Connection: assigns more jobs to real servers with
fewer active jobs.
最小连接调度(Least-Connection Scheduling)
• 算法是把新的连接请求分配到当前连接数最小的服务器。最小连接调度是
一种动态调度算法,它通过服务器当前所活跃的连接数来估计服务器的负
载情况。调度器需要记录各个服务器已建立连接的数目,当一个请求被调
度到某台服务器,其连接数加1;当连接中止或超时,其连接数减一。
wlc - Weighted Least-Connection: assigns more jobs to servers
with fewer jobs and relative to the real servers’ weight
(Ci/Wi). This is the default.
加权最小连接调度(Weighted Least-Connection Scheduling)
• 算法是最小连接调度的超集,各个服务器用相应的权值表示其处理性能。
服务器的缺省权值为1,系统管理员可以动态地设置服务器的权值。加权最
小连接调度在调度新连接时尽可能使服务器的已建立连接数和其权值成比例。
lblc - Locality-Based Least-Connection: assigns jobs destined
for the same IP address to the same server if the server is not
overloaded and available; otherwise assign jobs to servers with
fewer jobs, and keep it for future assignment.
基于局部性的最少链接(Locality-Based Least Connections Scheduling)
• 算法是针对请求报文的目标IP地址的负载均衡调度,目前主要用于Cache集群
系统,因为在Cache集群中客户请求报文的目标IP地址是变化的。这里假设任
何后端服务器都可以处理任一请求,算法的设计目标是在服务器的负载基本平
衡情况下,将相同目标IP地址的请求调度到同一台服务器,来提高各台服务器
的访问局部性和主存Cache命中率,从而整个集群系统的处理能力。
lblcr - Locality-Based Least-Connection with Replication:
assigns jobs destined for the same IP address to the least-con-
nection node in the server set for the IP address. If all the
node in the server set are over loaded, it picks up a node with
fewer jobs in the cluster and adds it in the sever set for the
target. If the server set has not been modified for the speci-
fied time, the most loaded node is removed from the server set,
in order to avoid high degree of replication.
带复制的基于局部性最少链接
(Locality-Based Least Connections with Replication Scheduling)
• 它与LBLC算法的不同之处是它要维护从一个目标IP地址到一组服务器的映射,
LBLC算法维护从一个目标IP地址到一台服务器的映射。
dh - Destination Hashing: assigns jobs to servers through look-
ing up a statically assigned hash table by their destination IP
addresses.
目标地址散列调度(Destination Hashing Scheduling)
• 算法也是针对目标IP地址的负载均衡,但它是一种静态映射算法,通过一个散列(Hash)
函数将一个目标IP地址映射到一台服务器。
• 目标地址散列调度算法先根据请求的目标IP地址,作为散列键(Hash Key)
从静态分配的散列表找出对应的服务器,若该服务器是可用的且未超载,将请求发送到该服务器,否则返回空。
sh - Source Hashing: assigns jobs to servers through looking up
a statically assigned hash table by their source IP addresses.
源地址散列调度(Source Hashing Scheduling)
• 算法正好与目标地址散列调度算法相反,它根据请求的源IP地址,作为散列键(Hash Key)
从静态分配的散列表找出对应的服务器,若该服务器是可用的且未超载,将请求发送到该服务器,否则返回空。
• 它采用的散列函数与目标地址散列调度算法的相同。
sed - Shortest Expected Delay: assigns an incoming job to the
server with the shortest expected delay. 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 the ith server
and Ui is the fixed service rate (weight) of the ith server.
nq - Never Queue: assigns an incoming job to an idle server if
there is, instead of waiting for a fast one; if all the servers
are busy, it adopts the Shortest Expected Delay policy to assign
the job.
不排队调度(Never Queue Scheduling)
• 如果有空闲的机器,就立刻分配任务给他,没有的时候按算法9来处理。