Draining Netscaler 9.1 Services

It took me a while to figure this one out. In order to safely and effectively drain connections from a service or services on a Netscaler virtual server, follow this procedure. The services must not have infinite cookies, i.e., if your service is set for COOKIEINSERT with a timeout of 0, this may not work effectively.

Two default settings on LB services and virtual servers to note are ‘Down state flush‘ on the Advanced tab and the ‘Weight‘ value on the LBVS Services tab.

  • Disabling ‘Down state flush’ on a service and/or LBVS allows active sessions to remain active in the event that a service is in the ‘out of service’ state. The default for the Netscaler is enabled (checked).
    • If enabled, all sessions to a service are severed if it goes out of service.
    • Unchecking this option will allow active sessions to timeout before being kicked. When this option is not enabled and you disable a service, you will be prompted to specify a timeout in seconds. The service will be set to ‘Out of service’ at which time subsequent sessions are created on the higher weighted services in the LBVS.

Remember that a higher value weight gets more connections than a lower value. Depending upon which method you are using (least connection, round robin, etc.) connections will be sent using the Netscaler’s algorithm; the higher value will get a higher percentage of connections.

  1. Load Balancing -> Services:
    • Uncheck the ‘Down state flush’ option in the Advanced tab of the services assigned to your load balancing virtual server.
  2. Load Balancing -> Virtual Servers:
    • Open the LBVS that contains the services from step 1.
      • In the Services tab, set the weight of the service to disable to 1 and the weight of the service to remain in the pool to 100, then OK to save the config.
      • In the Advanced tab, uncheck the ‘Down state flush’ option.
  3. Load Balancing -> Services:
    • Right-click the service you want to disable and click Disable.
    • Enter the time in seconds before the service goes down, then click Enter.

Once you click Enter the service should show as ‘Out of service’. Sessions will begin to drain from it as they time out and the service weighted 100 should begin to accept more connections.



Set weight values. Higher values get higher priority for connections.



Disable ‘Down state flush’




Set desired time in seconds before service is disabled.