Configuring Persistence based on Server IDs in URLs

The Citrix NetScaler initially selects a server by using a load balancing method. With persistence configured, enabling the NetScaler to send any subsequent client requests to the selected server, the server can access state information for that client. If persistence is configured, it overrides the load balancing methods once the server has been selected. If the configured persistence applies to a service that is down, the NetScaler uses the load balancing methods to select a new service, and the new service becomes persistent for subsequent requests from the client. If the state of the selected service is “out of service”, it continues to serve the outstanding requests, but it does not allow new requests or connections. After the shutdown period elapses, no new requests or connections are directed to the service and the existing connections are closed.

The NetScaler can maintain persistence based on the server ID in the URLs. In a technique called URL passive persistence type, the NetScaler extracts the server ID from the server response and embeds it in the URL query of the client request. The server ID is its IP address and port specified as a hexadecimal number. The NetScaler extracts the server ID from subsequent client requests and uses it to select the server.

Example: Payload Expression

The expression, URLQUERY contains sid= configures the NetScaler to extract the server ID from the URL query of a client request, after matching token sid=. Thus, a request with the URL http://www.citrix.com/index.asp?&sid=0A661D0A0050 is directed to the server with the IP address 10.102.29.10 and port 80. The time-out value does not affect this persistence type. This persistence type is maintained as long as the server ID can be extracted from the client requests. This persistence type does not consume any NetScaler resources, so it can accommodate an unlimited number of persistent clients. To configure persistence based on server IDs in a URL, in the Persistence list, select URLPASSIVE.

Configuring Persistence Based on Server IDs in Client Requests

The NetScaler can maintain persistence based on the server ID that you provide. The persistence type requires you to provide the server ID and embeds the server ID in the response. The NetScaler extracts the server ID from subsequent requests and uses it to choose a server. The server ID value must be in the range 0 through 65535. You must configure the same number in the NetScaler for the corresponding service. This persistence type is called Custom Server ID persistence. The Custom Server ID persistence type requires a payload expression, or an advanced expression to be configured that specifies the location of the server ID in the client requests.

If a server ID cannot be extracted from the client requests, server selection is performed based on the load balancing method. Avoid using the same server ID for multiple services.

Example: Payload Expression

Two servers, Server-1 and Server-2, are configured, where Server-1 has the Server-ID=5 and Server-2 has the Server-ID=6. The services for these servers are bound to the virtual server Vserver-LB-1. The expression URLQUERY contains sid= configures the NetScaler to extract the Server-ID from the URL query of the client requests, after matching token “sid=”. Thus, a request with the URL http://www.citrix.com/index.asp?&sid=6 that arrives on Vserver-LB-1 is directed to the server Server-2. The time-out value does not affect this persistence type. Persistence is maintained for as long as a server ID can be extracted from the client requests. This persistence type does not consume any NetScaler resources, so it can accommodate an unlimited number of persistent clients. To configure persistence based on server IDs in client requests, in the Persistence list, select CUSTOMSERVERID.




Get the most powerful Persistence Load Balancer here.




It’s powerful!

UPDATE 10/23/2013:

http://www.citrix.com/index.asp?&sid=c0a864100050 was incorrect and has been updated to http://www.citrix.com/index.asp?&sid=0A661D0A0050