In the Custom Server ID persistence method, the Server ID specified in the client request is used to maintain persistence. For this type of persistence to work, you must first set a server ID on the services. The NetScaler appliance checks the URL of the client request and connects to the server associated with the specified server ID. The service provider should make sure that the users are aware of the server IDs to be provided in their requests for specific services.
For example, if your site provides different types of data, such as images, text, and multimedia, from different servers, you can assign each server a server ID. On the NetScaler appliance, you specify those server IDs for the corresponding services, and you configure custom server ID persistence on the corresponding load balancing virtual server. When sending a request, the client inserts the server ID into the URL indicating the required type of data.
To configure custom server ID persistence:
- In your load balancing setup, assign a server ID to each service for which you want to use the user-defined server ID to maintain persistence. Alphanumeric server IDs are allowed.
- Specify rules, in the default-syntax expression language, to examine the URL queries for the server ID and forward traffic to the corresponding server.
- Configure custom server ID persistence.
Note: The persistence time-out value does not affect the Custom Server ID persistence type. There is no limit on the maximum number of persistent clients because this persistence type does not store any client information.
In a load balancing setup with two services, assign server ID 2345-photo-56789
to Service-1, and server ID 2345-drawing-abb123
to Service-2. Bind these services to a virtual server named Web11.
set service Service-1 10.102.29.5 -CustomServerID 2345-photo-56789
set service Service-2 10.102.29.6 -CustomServerID 2345-drawing-abb123
On virtual server Web11, enable Custom Server ID persistence.
set lb vserver Web11 -persistenceType customserverID
bind lb vserver Web11 Service-[1-2]
Create the following expression so that all URL queries containing the string "sid=" are examined.
When a client sends a request with the following URL to the IP address of Web11, the NetScaler directs the request to Service-2 and honors persistence.
For more information about default-syntax policy expressions, see the Policy Configuration and Reference.