Link to home
Start Free TrialLog in
Avatar of compdigit44
compdigit44

asked on

Netscaler 10 Draining a Service

A while back I open the following question on how to drain a service. https://www.experts-exchange.com/questions/28460073/Netscaler-9-3-How-to-Drain-Service.html

I at that time we were running Netscaler 9.3 but have since upgrade to 10.1.

This morning I needed to drain a number of services and did the following.

1) For the service unchecked "Down State Flush" and clicked OK
2) Reopened the service and selected disabled and graceful shutdown and left the time to 0

I noticed after I clicked ok within seconds the service was listed as "out of service"

DId I do the correct process to drain a service?
Avatar of btan
btan

A virtual server marked as DOWN happened likely when there is no one service bound to the vserver. it should not stay DOWN is there is service bound to vserver. Maybe can check further if "show vserver <VServer_Name>" can reveal any leads.
The understanding is also if existing connection is flushed e.g. Down state enabled, the Netscaler would try to re-transmit the packet to a different server. So the state should be reverted if different server is readily available during the retransmit.

We also need to consider this Down state is for vserver or server. for the vserver, both client and server links are applicable while for server, only server to vserver link is applicable. The down state flush option is enabled on the vserver by default, and it should flush the client side connections.

However, if the "Down State Flush" is unchecked (disabled), retransmit will not be done in state of DOWN. So, if client to server is "hang" and not timeout, there is no Netscalar doing retransmit. It should still remain as previous state which is likely not DOWN.

Also good to check support to see if this is expected.
Avatar of compdigit44

ASKER

I set the service(s) for the service I want to drain to "Disable Down State Flush by deselecting the check box and selecting a graceful shutdown.

From my understand by default Down State Flush is enabled and drops all connects when disabled removing this check box should not do this. Is my understanding correct.

The Vserver this server was a member up stayed up and was working fine. I am trying to understand why the service was marked out of service so fast or if I did something wrong..
Yes it is by default enabled as also mentioned in my post. In fact, upon disabled state, it delays clean up of connections on that vserver if its's state is down. Note that that vserver state depends on the states of the services that are bound to it, the state of service is bound to its monitor. So (to be expected) the vserver is marked as DOWN only when all services bound to it are marked as DOWN. Check out the official standpoints
Disabling the Down State Flush feature changes this behavior; when the service is disabled all the in-flight connections are honored and no new connections are serviced by this service. If there is a persistent connection from the client, that also is not be honored.

The service can be disabled and set a timer (say 10 seconds), which indicates that the service honors all the existing connections including the persistent connections until the timer times out, and no new connections are honored. The Down State Flush starts after the timer times out.
http://support.citrix.com/article/CTX124710

Since you set those accordingly and even the timeout as 0, logically it should tear away and cleared associated TCP session table. Supposedly, some sort of 503 service unavailable is expected.

Most of the time, it is best to let the flag stay "enabled" unless otherwise due to slow network and impacting backend service effectively..
Thank you for your response..

Can you please explain what you mean by ..."Most of the time, it is best to let the flag stay "enabled" unless otherwise due to slow network and impacting backend service effectively"  Which flag are you referring to.

Maybe I am being dense here but are you stating that I did or did not follow the correct process to drain a service.... ;-) Long day at work.
The "Enabled" is recommended by Citrix hence it is also default setting - in other words, let the box handle the connection rather than manual intervention. Of course, you can (and have) opted for graceful shutdown option, on top of flushing only, to also disable a service only when all the established connections are closed by the server or the client. See this for more details on the grace shutdown option
http://support.citrix.com/proddocs/topic/netscaler-load-balancing-93/ns-lb-clienttraffic-gracefulshutdown-tsk.html

You have followed the steps no difference just that to clarify that the service DOWN has several consideration stated as in the kb and its posting, we have to consider that as well. If as based that there is no service bound and as per monitor, and no existing live session for the vserver, the moment it switched to "disabled",  all connections should be immediately reset. Moe specific details in (though in v9.3 but should be applicable for discussion sake)
http://support.citrix.com/proddocs/topic/netscaler-load-balancing-93/ns-lb-clienttraffic-downstateflush-tsk.html#ns-lb-clienttraffic-downstateflush-tsk

not sure if there are any bugs if it shows otherwise..hence support to clarify instead
Good points...

So if I were to leave "Downstate FLush" enabled yet select. Graceful shutdown it should do the same thing...

Part me me feels safer to manually control this though.. Might be force of habit though.
ASKER CERTIFIED SOLUTION
Avatar of btan
btan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial