NetScaler ingress controller

Configuring consistent hashing algorithm using NetScaler Ingress Controller

Load balancing algorithms define the criteria that the NetScaler appliance uses to select the service to which to redirect each client request. Different load balancing algorithms use different criteria and consistent hashing is one the load balancing algorithms supported by NetScaler. Consistent hashing algorithms are often used to load balance when the back-end is a caching server to achieve stateless persistency. Consistent hashing can ensure that when a cache server is removed, only the requests cached in that specific server is rehashed and the rest of the requests are not affected. For more information on the consistent hashing algorithm, see the NetScaler documentation.

You can now configure the consistent hashing algorithm on NetScaler using NetScaler Ingress Controller. This configuration is enabled with in the NetScaler Ingress Controller using a ConfigMap.

Configure hashing algorithm

A new parameter NS_LB_HASH_ALGO is introduced in the NetScaler Ingress Controller ConfigMap for hashing algorithm support. Supported environment variables for consistent hashing algorithm using ConfigMap under the NS_LB_HASH_ALGO parameter:

  • hashFingers: Specifies the number of fingers to be used for the hashing algorithm. Possible values are from 1 to 1024. Increasing the number of fingers provides better distribution of traffic at the expense of extra memory.
  • hashAlgorithm: Specifies the supported algorithm. Supported algorithms are default, jarh, prac.

The following example shows a sample ConfigMap for configuring consistent hashing algorithm using NetScaler Ingress Controller. In this example, the hashing algorithm is used as Prime Re-Shuffled Assisted CARP (PRAC) and the number of fingers to be used in PRAC is set as 50.

    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: cic-configmap
    labels:
        app: citrix-ingress-controller
    data:
    NS\_LB\_HASH\_ALGO: |
        hashFingers: 50
        hashAlgorithm: 'prac'
Configuring consistent hashing algorithm using NetScaler Ingress Controller