Fine Tuning Load Balancing with Weights

The load balancing algorithm (or load balancing method) defines the criteria that the NetScaler uses to select the server to which to send client requests. When the configured criteria are met for the selected server, the NetScaler then selects a different server.

The least connections method selects the server with the least number of active connections to ensure that the load of the active requests is balanced on the servers. Some of these Load Balancing Algorithms (load balancing methods) allow for even further granularity of configuration by using “Weights”. The default Load Balancing Algorithm is the Least Connections Method, so we will use that as an example to show how weights are used with Load Balancing.

The NetScaler has the ability to select a server based on a weighted value N{w} of the following expression:
N{w} = (Number of active transactions) * (10000 / weight)

The following example shows how the NetScaler selects a server for load balancing by using least connections method when the weights are assigned.

Suppose Server-1 is assigned a weight of 2, Server-2 is assigned a weight of 3, and Server-3 is assigned a weight of 4. The requests are delivered as follows:

  • Server-3 receives the first request because the server is not handling any active transactions.
    Note: If servers are not handling any active transactions, NetScaler selects them in a round robin manner regardless of the weights assigned to them.
  • Server-3 receives the second, third, fourth, fifth, sixth, and seventh requests because the server has least
    N{w} value.
  • Server-1 receives the eighth request. Because Server-1 and Server-3 have same N{w} value, the NetScaler performs load balancing in a round robin manner.
  • Therefore, Server-3 receives the ninth request.

The manner in which a service receives requests based on the N{w} value is summarized in the following table. The Load Balancing Algorithms (load balancing methods) that allow for the use of weights in the configuration are Round Robin, Least Connections Method, Least Response Time Method, Least Bandwidth Method, Least Packets Method, and Custom Load Method.

Get Citrix NetScaler here

It’s powerful!