ADC

Least bandwidth method

A load balancing virtual server configured to use the least bandwidth method selects the service that is currently serving the least amount of traffic, measured in megabits per second (Mbps). The following example shows how the virtual server selects a service for load balancing by using the least bandwidth method.

Consider three services, Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3.

  • Service-HTTP-1 has 3 Mbps bandwidth.
  • Service-HTTP-2 has 5 Mbps bandwidth.
  • Service-HTTP-3 has 2 Mbps bandwidth.

The following diagram illustrates how the virtual server uses the least bandwidth method to forward requests to the three services.

Figure 1. How the Least Bandwidth Load Balancing Method Works

least-bandwidth

The virtual server selects the service by using the bandwidth value (N), which is the sum of the number of bytes transmitted and received over the previous 14 seconds. If each request requires 1 Mbps bandwidth, the Citrix ADC appliance delivers requests as follows:

  • Service-HTTP-3 receives the first request, because this service has the lowest N value.
  • Since Service-HTTP-1 and Service-HTTP-3 now have same N value, the virtual server switches to the round robin method for these servers, alternating between them. Service-HTTP-1 receives the second request, Service-HTTP-3 receives the third request, Service-HTTP-1 receives the fourth request, Service-HTTP-3 receives the fifth request, and Service-HTTP-1 receives the sixth request.
  • Since Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 now all have same N value, the virtual server includes Service-HTTP-2 in the round robin list. Therefore, Service-HTTP-2 receives the seventh request, Service-HTTP-3 receives the eighth request, and so on.

The following table summarizes how N is calculated.

Request Received Service Selected Current N Value Remarks
Request-1 Service-HTTP-3; (N = 2) N = 3 Service-HTTP-3 has the lowest N value.
Request-2 Service-HTTP-1; (N = 3) N = 4 Service-HTTP-1 and Service-HTTP-3 have the same N values.
Request-3 Service-HTTP-3;(N = 3) N = 4 Service-HTTP-1 and Service-HTTP-3 have the same N values.
Request-4 Service-HTTP-1; (N = 4) N = 5 -
Request-5 Service-HTTP-3; (N = 4) N = 5 -
Request-6 Service-HTTP-1; (N = 5) N = 6 Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 have the same N values.
Request-7 Service-HTTP-2; (N = 5) N = 6 Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 have the same N values.
Request-8 Service-HTTP-3; (N = 5) N = 6 -

Note: If you enable the RTSP NAT option on the virtual server, the Citrix ADC appliance uses the number of data and control bytes exchanged to determine the bandwidth usage for RTSP services. For more information about RTSP NAT option, see Managing RTSP Connections.

The Citrix ADC appliance also performs load balancing by using the bandwidth and weights if different weights are assigned to the services. It selects a service by using the value (Nw) in the following expression:

Nw = (N) * (10000 / weight)

As in the preceding example, suppose Service-HTTP-1 is assigned a weight of 2, Service-HTTP-2 is assigned a weight of 3, and Service-HTTP-3 is assigned a weight of 4. The Citrix ADC appliance delivers requests as follows:

  • Service-HTTP-3 receives the first second, third, fourth, and fifth requests, because this service has the lowest Nw value.
  • Service-HTTP-1 receives the sixth request, because this service has the lowest Nw value.
  • Service-HTTP-3 receives the seventh request, because this service has the lowest Nw value.
  • Service-HTTP-2 receives the eighth request, because this service has the lowest Nw value.

The following table summarizes how Nw is calculated.

Request Received Service Selected Current Nw Value (Number of Active Transactions) * (10000 / Weight) Remarks
Request-1 Service-HTTP-3; (Nw = 5000) Nw = 5000 Service-HTTP-3 has the lowest Nw value.
Request-2 Service-HTTP-3; (Nw = 5000) Nw = 7500 -
Request-3 Service-HTTP-3; (Nw = 7500) Nw = 10000 -
Request-4 Service-HTTP-3; (Nw = 10000) Nw = 12500 -
Request-5 Service-HTTP-3; (Nw = 12500) Nw = 15000 -
Request-6 Service-HTTP-1; (Nw = 15000) Nw = 20000 Service-HTTP-1 and Service-HTTP-3 have the same Nw value.
Request-7 Service-HTTP-3; (Nw = 15000) Nw = 17500 Service-HTTP-1 and Service-HTTP-3 have the same Nw value.
Request-8 Service-HTTP-2; (Nw = 16666.67) Nw = 20000 Service-HTTP-2 has the lowest Nw value.

The following diagram illustrates how the virtual server uses the least bandwidth method when weights are assigned to the services.

Figure 2. How the Least Bandwidth Load Balancing Method Works When Weights Are Assigned

lbm-weights

To configure the least bandwidth method, see Configuring a Load Balancing Method that Does Not Include a Policy.

Least bandwidth method