Netscaler 10 Draining a Service

A while back I open the following question on how to drain a service.

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?
LVL 21
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

btanExec ConsultantCommented:
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.
compdigit44Author Commented:
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..
btanExec ConsultantCommented:
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.

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..
compdigit44Author Commented:
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.
btanExec ConsultantCommented:
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

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)

not sure if there are any bugs if it shows otherwise..hence support to clarify instead
compdigit44Author Commented:
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.
btanExec ConsultantCommented:
yes indeed. for info on graceful shutdown , reference to
No Graceful: all connections will be dropped either immediately (setting = 0 secs) or after X seconds. New connections allowed until that time.
Graceful enabled: If the timeout is set to 0, then no new connections allowed, and all existing connections will continue until they have finished; if non-zero, then no new connections allowed, and existing connections will drop after X seconds.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.