ADC

Custom load method

Custom load balancing is performed on server parameters such as CPU usage, memory, and response time. When using the custom load method, the Citrix ADC appliance usually selects a service that is not handling any active transactions. If all the services in the load balancing setup are handling active transactions, the appliance selects the service with the smallest load. A special type of monitor, known as a load monitor, calculates the load on each service in the network. The load monitors do not mark the state of a service, but they do take services out of the load balancing decision when those services are not UP.

For more information about load monitors, see Understanding Load Monitors. The following diagram illustrates how a load monitor operates.

Figure 1. How Load Monitors Operate

CustomLoad_working

The load monitor uses SNMP probes to calculate the load on each service by sending an SNMP GET request to the service. This request contains one or more object IDs (OIDs). The service responds with an SNMP GET response, with metrics corresponding to the SNMP OIDs. The load monitor uses the response metrics to calculate the load on the service.

The load monitor calculates the load on a service by using the following parameters:

  • Metrics values retrieved through SNMP probes that exist as tables in the Citrix ADC appliance.
  • Threshold value set for each metric.
  • Weight assigned to each metric.

For example, consider three services, Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3.

  • Service-HTTP-1 is using 20 MB of memory.
  • Service-HTTP-2 is using 70 MB of memory.
  • Service-HTTP-3 is using 80 MB of memory.

The load balanced servers can export metrics such as CPU and memory usage to the services, which can in turn provide them to the load monitor. The load monitor sends an SNMP GET request containing the OIDs 1.3.6.1.4.1.5951.4.1.1.41.1.5, 1.3.6.1.4.1.5951.4.1.1.41.1.4, and 1.3.6.1.4.1.5951.4.1.1.41.1.3 to the services. SNMP OIDs of type STRING are not supported, because you cannot calculate the load by using a STRING OID. Loads can be calculated by using other data types, such as INT and gauge32. The three services respond to the request. The Citrix ADC appliance compares the exported metrics, and then selects Service-HTTP-1 because it has more available memory. The following diagram illustrates this process.

Figure 2. How the Custom Load Method Works

custom_working2

If each request uses 10 MB memory, the Citrix ADC appliance delivers requests as follows:

  • Service-HTTP-1 receives the first, second, third, fourth, and fifth requests, because this service has the lowest N value.
  • Service-HTTP-1 and Service-HTTP-2 now have the same load, so the virtual server reverts to the round robin method for these servers. Therefore, Service-HTTP-2 receives the sixth request, and Service-HTTP-1 receives the seventh request.
  • Since Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 all now have the same load, the virtual server reverts to the round robin method for Service-HTTP-3 as well. Therefore, Service-HTTP-3 receives the eighth request.

The following table summarizes how N is calculated.

Request received Service selected Current N Value (Number of Active Transactions) Remarks
Request-1 Service-HTTP-1; (N = 20) N = 30 Service-HTTP-3 has the lowest N value.
Request-2 Service-HTTP-1; (N = 30) N = 40 -
Request-3 Service-HTTP-1; (N = 40) N = 50 -
Request-4 Service-HTTP-1; (N = 50) N = 60 -
Request-5 Service-HTTP-1; (N = 60) N = 70 -
Request-6 Service-HTTP-1; (N = 70) N = 80 Service-HTTP-2 and Service-HTTP-3 have the same N values.
Request-7 Service-HTTP-2; (N = 70) N = 80 Service-HTTP-3 have the same N values.
Request-8 Service-HTTP-1; (N = 80) N = 90 Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 have the same N values.

If different weights are assigned to the services, the custom load algorithm considers both the load on each service and the weight assigned to each service. 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 4, Service-HTTP-2 is assigned a weight of 3, and Service-HTTP-3 is assigned a weight of 2. If each request uses 10 MB memory, the Citrix ADC appliance delivers requests as follows:

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

Service-HTTP-3 has the highest Nw value, and is therefore not considered for load balancing.

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-1; (Nw = 50000) Nw = 75000 Service-HTTP-1 has the lowest Nw value.
Request-2 Service-HTTP-1; (Nw = 5000) Nw = 100000 -
Request-3 Service-HTTP-1; (Nw = 15000) Nw = 125000 -
Request-4 Service-HTTP-1; (Nw = 20000) Nw = 150000 -
Request-5 Service-HTTP-1; (Nw = 23333.34) Nw = 175000 -
Request-6 Service-HTTP-1; (Nw = 25000) Nw = 200000 -
Request-7 Service-HTTP-1; (Nw = 23333.34) Nw = 225000 -
Request-8 Service-HTTP-1; (Nw = 25000) Nw = 250000
Request-9 Service-HTTP-2; (Nw = 233333.34) Nw = 266666.67 Service-HTTP-2 has the lowest Nw value.

Service-HTTP-1 is selected for load balancing when it completes its active transactions or when the Nw value of other services (Service-HTTP-2 and Service-HTTP-3) is equal to 400,000.

The following diagram illustrates how the Citrix ADC appliance uses the custom load method when weights are assigned.

Figure 3. How the Custom Load Method Works When Weights Are Assigned

Custom load weights

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

Custom load method