CF911: Tips for dealing with Windows service timeout, useful when CF's taking too long to stop/start
Note: This blog post is from 2011. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.In my last entry, CF911: Is your ColdFusion service taking too long to shut down? Find out why, I discussed the first of a two part answer to helping people who are finding that sometimes ColdFusion takes too long to shut down (or startup). That one talks about how to find out where CF may be logging info to explain why it's taking so long.
In this second entry, I'll address the separate but related problem, particularly if you're running CF as a Windows service, that you may find you get timeout errors from the Windows Services panel itself. I'll share some tips to help with that, which I share often with clients of my independent consulting as a CF troubleshooter.
The first thing to understand is that there is indeed a timeout (configurable) for how long the Windows Services control panel is willing to wait. Beyond that, though, there are some 3 more tricks you can use to avoid that timeout. (And I would say again that sometimes you really want to focus instead on WHY CF is taking so long to startup or shutdown, but until you do, the following info may help give you some breathing room.)
The solution is actually really simple. If the service seems like it is not going to restart before it times out Just open the task manager and kill jrun, the service will then restart successfully.
Anyway, yeah, I realize one COULD kill the task. I assumed people knew that. This entry was a follow-up to the last, explaining how one could let it shutdown (despite the services timeout issue) if you wanted to.
But just to avoid any more confusion, I've just updated the entry to make that clear and credited you for making the pointing.
In case you don't know the command prompt command it is
net stop "coldfusion 9 application server"
net start "coldfusion 9 application server"
the quotes didn't seem to always be required, but they never hurt to have them there.
I know: perhaps too much info to read it all. :-)
http://www.adobe.com...
If the other info above doesn't help with an unexpected problem of timeouts during startup or shutdown, consider this (whether the impact of the defaults, or the prospect of modifying these values.)
What would account for the huge amount of time required for CF to re-start on one of my servers, but not the other?
ServicePipeTimeout has nothing to do with killing a service. It has to do with the start-up process and tells the service manager to wait the specified amount of time before giving error (7000 etc ...) that something couldn't start or whatever because something else didn't start. If you have something that starts a little slow you increase the variable in SPT to 60 or greater to tell the service manager to chill. This only pertains to the starting side of a start or restart not the shutting down.
And I will admit I may have gotten something wrong (if you are referring to something in the blog entry or a comment from me), but I am not seeing the immediate connection (and at the moment I haven't the time to reread the blog entry, from 2011, and all the comments) to try to connect those dots.
Thanks.
This article is about Service Control Panel timeouts and about killing a service faster. (in this case, CF when run as a service) In the (second) paragraph of 'Tip 1' you state
[QUOTE]
And technically, you should be able to control that timeout via a registry key, called ServicesPipeTimeout, which is discussed in this Microsoft technote and defined in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control.
[END QUOTE]
The Service Control Manager (SCM) controls the starting/stopping of services. The above mentioned SystemPipeTimeout ONLY controls a STARTUP timeout before the SCM will issue an error for a slow or non starting service. That is why, as you stated, you could not get it to work on several different machines because, the reg key solution you were trying has NOTHING to do with shutdown timeout errors or the Service Control Panel's speed at which it kills services. As for the speed that services are killed, that is controlled by the "WaitToKillServicesTimeout" that you said "is NOT related to this discussion".
So, I'm sure you can see my 1st comment WAS actually referring to something in your article, namely Tip 1 and consequently what my point would be that you were asking about.
michael clyde
So thanks for connecting that dot. And thanks again for trying to help clarify where you feel I was mistaken regarding that. I have now reread the blog entry, and your comments. I still think we're not on the same page. Since you want to make your points clear, let me respond to them.
Your first comment says this ServicesPipeTimeout setting "has nothing to do with killing a service". Well, I didn't say it did. Instead I referenced an MS article which said that value "represents the time in milliseconds before a service times out". And I was discussing it in a section entitled, "There is a timeout set for how long the Windows Services panel will wait". So I was not talking about "killing a service".
i then pointed out in the same section an available WaitToKillServiceTimeout registry entry, and that does refer to "killing" a service, but I noted that it was "NOT related to this discussion". And you reference this later, so I'll get back to that in a moment.
So I guess I'm wondering first what led you to comment that I was asserting the ServicesPipeTimeout DID kill a service. It seems I did not.
Second, you conclude your first comment saying that this setting "only pertains to the starting side of a start or restart not the shutting down." OK, we're on the same page there. The blog entry begins "Tips for dealing with Windows service timeout". I was indeed focused on "the starting side of a start" as well as the stopping.
Your next comment now says that you feel this blog entry is "about killing a service faster". Well not quite. Again, it was about understanding why a service may not start/stop when you expect it should, and some possibilities related to that.
Then you clarify in this second comment that the ServicesPipeTimeout setting "has NOTHING to do with shutdown timeout errors". Well, again, I didn't say it did. Even having reread things now, I just don't see me saying what you say I am.
As for my having "tried it on multiple machines" and "not finding it to work", I was referring to its control of the time for how long it takes the service to start, in the control panel. Again, I wasn't saying it had anything to with "killing" the service. It's a subtlety, but I just want to clarify what I was saying.
Now, I gather you have a sincere concern about misinterpretation of this setting, and fair enough. I just don't see anything I need to change, but if you (or anyone else reading this) sees something I did misstate, do let me know and I'd change it.
BTW, you switched to referring to "SystemPipeTimeout" but I assume you meant ServicesPipeTimeout.
That said, you also say that this "has NOTHING to do with shutdown timeout errors" and " ONLY controls a STARTUP timeout before the SCM will issue an error". Are you sure it doesn't cover both starts and stops of a service? Even if it does control only one of them, I don't see that changing what I said, but if it does control both, then it would change what you said.
Again, I'm just trying to be as clear as you, for the sake of those reading along.
And in fact, you conclude saying that "As for the speed that services are killed, that is controlled by the "WaitToKillServicesTimeout". Well, hold on there. First, again to be clear, that's NOT to be pluralized. It's WaitToKillServiceTimeout. (I'm not picking on you, it's just that it really would help readers for us both to be as clear on these things as possible).
Second, though, I said it's "not related to this discussion" because according to the docs I read (and point to when I referenced it), that affects how long Windows is willing to wait when it, Windows, IS SHUTTING DOWN, and is trying to stop services in that process, before it will just kill a service that's taking too long to stop properly. And that does indeed have "nothing to do" with this discussion about "Tips for dealing with Windows service timeout", in the context I have presented this topic.
If you feel I still have said something wrong, after these clarifications, let me know. I'm open to correcting mistakes. If you just read things differently than I now show I wrote them, and you want to let it be, that's cool too. I'm open to dialogue and want to put further accurate information. Thanks for your points of clarification.
https://adminsissues...