Chapter 1. Linux Virtual Server Overview6Weighted Least-Connections (default)Distributes more requests to servers with fewer active connections relative to their capacities.Capacity is indicated by a user-assigned weight, which is then adjusted upward or downwardby dynamic load information. The addition of weighting makes this algorithm ideal when the realserver pool contains hardware of varying capacity. Refer to Section 1.3.2, “Server Weight andScheduling” for more on weighting real servers.Locality-Based Least-Connection SchedulingDistributes more requests to servers with fewer active connections relative to their destination IPs.This algorithm is designed for use in a proxy-cache server cluster. It routes the packets for an IPaddress to the server for that address unless that server is above its capacity and has a server inits half load, in which case it assigns the IP address to the least loaded real server.Locality-Based Least-Connection Scheduling with Replication SchedulingDistributes more requests to servers with fewer active connections relative to their destination IPs.This algorithm is also designed for use in a proxy-cache server cluster. It differs from Locality-Based Least-Connection Scheduling by mapping the target IP address to a subset of realserver nodes. Requests are then routed to the server in this subset with the lowest number ofconnections. If all the nodes for the destination IP are above capacity, it replicates a new serverfor that destination IP address by adding the real server with the least connections from the overallpool of real servers to the subset of real servers for that destination IP. The most loaded node isthen dropped from the real server subset to prevent over-replication.Destination Hash SchedulingDistributes requests to the pool of real servers by looking up the destination IP in a static hashtable. This algorithm is designed for use in a proxy-cache server cluster.Source Hash SchedulingDistributes requests to the pool of real servers by looking up the source IP in a static hash table.This algorithm is designed for LVS routers with multiple firewalls.1.3.2. Server Weight and SchedulingThe administrator of LVS can assign a weight to each node in the real server pool. This weight is aninteger value which is factored into any weight-aware scheduling algorithms (such as weighted least-connections) and helps the LVS router more evenly load hardware with different capabilities.Weights work as a ratio relative to one another. For instance, if one real server has a weight of 1 andthe other server has a weight of 5, then the server with a weight of 5 gets 5 connections for every 1connection the other server gets. The default value for a real server weight is 1.Although adding weight to varying hardware configurations in a real server pool can help load-balancethe cluster more efficiently, it can cause temporary imbalances when a real server is introduced to thereal server pool and the virtual server is scheduled using weighted least-connections. For example,suppose there are three servers in the real server pool. Servers A and B are weighted at 1 andthe third, server C, is weighted at 2. If server C goes down for any reason, servers A and B evenlydistributes the abandoned load. However, once server C comes back online, the LVS router sees ithas zero connections and floods the server with all incoming requests until it is on par with servers Aand B.To prevent this phenomenon, administrators can make the virtual server a quiesce server — anytimea new real server node comes online, the least-connections table is reset to zero and the LVS routerroutes requests as if all the real servers were newly added to the cluster.