Enable cleanup of virtual server and service connections

The state of a virtual server depends on the states of the services bound to it. The state of each service depends on the responses of the load balanced servers to probes or health checks sent by the monitors that are bound to that service. Sometimes the load balanced servers do not respond. If a server is slow or busy, monitoring probes can time out. If repeated monitoring probes are not answered within the configured timeout period, the service is marked DOWN. If a service or virtual server are marked DOWN, the server and client side connections must be flushed. Terminating existing connections frees resources, and in certain cases speeds recovery of overloaded load balancing setups.

Under certain conditions, you can configure the downStateFlush setting to immediately terminate existing connections when a service or a virtual server is marked DOWN. You must not enable the downStateFlush setting on those application servers that must complete their transactions. You can enable this setting on Web servers whose connections can safely be terminated when they marked DOWN.

The following table summarizes the effect of this setting on an example configuration consisting of a virtual server, Vserver-LB-1, with one service bound to it, Service-1. In the table, E and D denote the state of the downStateFlush setting: E means Enabled, and D means Disabled.

Vserver-LB-1 Service-1 State of Connections
E E Both client and server connections are terminated.
E D For some service types, such as TCP, for which the NetScaler appliance does not support connection reuse, both client and server connections are terminated. For service types, such as HTTP, for which the appliance supports connection reuse, both client and server connections are terminated only if a transaction is active on those connections. If a transaction is not active, only client connections are terminated.
D E For some service types, such as TCP, for which the NetScaler appliance does not support connection reuse, both client and server connections are terminated. For service types, such as HTTP, for which the appliance supports connection reuse, both client and server connections are terminated only if a transaction is active on those connections. If a transaction is not active, only server connections are terminated.
D D Neither client nor server connections are terminated.

If you want to disable a service only when all the established connections are closed by the server or the client, you can use the graceful shutdown option. For information about the graceful shutdown of a service, see Graceful Shutdown of Services.

To set down state flush on the service by using the CLI

At the command prompt, type:

set service <name>  -downStateFlush (ENABLED | DISABLED )

Example:

set service Service-HTTP-1 -downStateFlush enabled

To set down state flush on the service by using the GUI

  1. Navigate to Traffic Management > Load Balancing > Services, and open a service.
  2. In Advanced Settings, select Traffic Settings, and select Down State Flush.

To set down state flush on the virtual server by using the CLI

At the command prompt, type:

set lb vserver <name>  -downStateFlush (ENABLED | DISABLED )

Example:

set lb vserver vsvr1 -downStateFlush enabled

To set down state flush on the virtual server by using the GUI

  1. Navigate to Traffic Management > Load Balancing > Virtual Servers, and open a virtual server.
  2. In Advanced Settings, select Traffic Settings, and select Down State Flush.