24 May 2011

Server Load Balancing (SLB)

 SLB provides a virtual server IP address to which clients can connect, representing a group of real physical servers in a server farm. A client accesses a logical “virtual” server (IP address v.v.v.v), which exists only within the Catalyst 6500 SLB configuration. A group of physical “real” servers (IP addresses x.x.x.x, y.y.y.y, and z.z.z.z) is configured as a server farm. Traffic flows between clients and the virtual server are load balanced across the set of real servers, transparent to the clients.

■ As clients open new connections to the virtual server, SLB decides which real server to use based on a load-balancing algorithm.

■ Server load balancing is performed by one of these methods:

■ Weighted round-robin: Each real server is assigned a weight that gives it the capability to handle connections, relative to the other servers. For a weight n, a server is assigned new connections before SLB moves on to the next server.

■ Weighted least connections: SLB assigns new connections to the real server with the least number of active connections. Each real server is assigned a weight m, where its capacity for active connections is m divided by the sum of all server weights. SLB assigns new connections to the real server with the number of active connections farthest below its capacity.

SLB Example

SLB is configured to provide load balancing for two server farms: FARM1 and FARM2.















The virtual server VSERVER1 at 10.10.10.101 uses the weighted least connections algorithm for load balancing between the real servers. New connections are made sticky (passed to the real server last used by the same client) for 60 seconds. The CSM version of this example also includes the client and server-side VLAN numbers (10 and 20) and IP addresses (10.10.10.2 and 192.168.250.1). One server is given a weight of 32, one server has a weight of 16, and one server has a weight of 8. New connections are assigned to the server with the least number of active connections, as measured by the server capacities. For example, server 192.168.254.10 has a weight of 32 and a capacity of 32 /(32 + 16 + 8) or 32 / 56. Server 192.168.254.11 has a weight of 16 and a capacity of 16 /(32 + 16 + 8) or 16 / 56. Server 192.168.254.12 has a weight of 8 and a capacity of 8 /(32 + 16 + 8) or 8 / 56. At any given time, the server with the number of active connections furthest below its capacity is given a new connection.

The configuration that follows shows the commands that are necessary for server farm FARM1 and virtual server VSERVER1. The same configuration is shown for an IOS-based switch and a CSM module:

(global) ip slb serverfarm FARM1
(server-farm) predictor leastconns
(server-farm) nat server
(server-farm) probe HTTP1
(server-farm) real 192.168.250.10
(real-server) weight 32

(real-server) faildetect numconns 4
(real-server) retry 30
(real-server) inservice
(real-server) exit
(server-farm) real 192.168.250.11
(real-server) weight 16
(real-server) faildetect numconns 4
(real-server) retry 30
(real-server) inservice
(real-server) exit
(server-farm) real 192.168.250.12
(real-server) weight 8
(real-server) faildetect numconns 4
(real-server) retry 30
(real-server) inservice
(real-server) exit

(global) ip slb vserver VSERVER1
(virtual-server) serverfarm FARM1
(virtual-server) virtual 10.10.10.101 tcp www
(virtual-server) sticky 60 group 1
(virtual-server) advertise active
(virtual-server) inservice
(virtual-server) exit

(global) ip slb dfp password 0 test123
(slb-dfp) agent 192.168.250.10 2000
(slb-dfp) agent 192.168.250.11 2000
(slb-dfp) agent 192.168.250.12 2000
(slb-dfp) exit

(global) probe HTTP1 http
(probe) interval 120
(probe) port 80
(probe) request method get
(probe) exit

Displaying Information About SLB

Server farms (exec) show ip slb serverfarms [name serverfarm-name][detail]

Real servers (exec) show ip slb reals [vserver virtual-server-name][detail]

Virtual servers (exec) show ip slb vserver [name virtual-server-name][detail]

SLB connections (exec) show ip slb conns [vserver virtual-server-name | client ip-address][detail]

DFP status (exec) show ip slb dfp [agent agent-ip-address   port-number |manager manager-ip-address | detail | weights]

SLB redundancy (exec) show ip slb replicate

Probes (exec) show ip slb probe [name probe_name][detail]

SLB statistics (exec) show ip slb stats



See Also:

Cisco LAN Switching Configuration Handbook (2nd Edition)


biOos

No comments: