Contents

Weights to Services in Load Balancing

Website Visitors:

In a load balancing configuration, you assign weights to services to indicate the percentage of traffic that should be sent to each service. Services with higher weights can handle more requests; services with lower weights can handle fewer requests. Assigning weights to services allows the NetScaler appliance to determine how much traffic each load balanced server can handle, and therefore more effectively balance load.

Note: If you use a load balancing method that supports weighting of services (for example, the round robin method), you can assign a weight to the service.

The following table describes the load balancing methods that support weighting, and briefly describes the manner in which weighting affects how a service is selected for each one.

Load Balancing Methods Service Selection with Weights
Round Robin The virtual server prioritizes the queue of available services such that services with the highest weights come to the front of the queue more frequently than those with the lowest weights and receive proportionately more traffic. For a complete description, see The Round Robin Method.
Least Connection The virtual server selects the service with the best combination of fewest active transactions and highest weight. For a complete description, see The Least Connection Method.
Least Response Time and Least Response Time Method using Monitors The virtual server selects the service with the best combination of fewest active transactions and fastest average response time. For a complete description, see The Least Response Time Method.
Least Bandwidth The virtual server selects the service with the best combination of least traffic and highest bandwidth. For a complete description, see The Least Bandwidth Method.
Least Packets The virtual server selects the service with the best combination of fewest packets and highest weight. For a complete description, see The Least Packets Method.
Custom Load The virtual server selects the service with the best combination of lowest load and highest weight. For a complete description, see The Custom Load Method.
Hashing methods and Token method Weighting is not supported by these load balancing methods.

To configure a virtual server to assign weights to services by using the command line interface

At the command prompt, type:

set lb vserver <name>@ -weight <Value> <ServiceName>

Example

set lb vserver Vserver-LB-1 -weight 10 Service-HTTP-1

Parameter for setting weights

weight:

Weight to be assigned to the specified service. The minimum value is 1 and the maximum value is 100.

To configure a virtual server to assign weights to services by using the configuration utility

  1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.
  2. In the details pane, select the virtual server, and then click Open.
  3. On the Services tab, in the Weights spin box, type or select the weight to assign to the service (for example, 10).
  4. Click OK.

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 RobinLeast Connections MethodLeast Response Time MethodLeast Bandwidth MethodLeast Packets Method, and Custom Load Method.

https://www.mediafire.com/convkey/d79b/ynz4grlzc6xgvw57g.jpg

Want to learn more on Citrix Automations and solutions???

Subscribe to get our latest content by email.

If you like our content, please support us by sponsoring on GitHub below: