[Looking for Charlie's main web site?]

Vista (and Win 2008) now offers option to delay autostart of services

Note: This blog post is from 2008. 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.
I just noticed the other day that Vista (and Windows 2008) offers a new option for starting services: Automatic (Delayed Start). This is a pretty important (and for me, long-awaited) feature, whether in development or production. If you've ever felt that too many services were contending with each other as they all tried to start immediately on a restart, this is the solution.

According to various Microsoft resources I've found, such as this, the way it works is that delayed services start after those set to automatic have finished starting. Furthermore:

...it sets the priority of their initial thread to THREAD_PRIORITY_LOWEST. This priority level causes all the disk I/O the thread performs to be Very Low I/O priority. After a service finishes initializing, the Service Control Manager sets its priority to normal. The combination of the delayed start, low CPU and memory priority, and background disk priority greatly reduce interference with a user's logon. Many Windows services, including Background Intelligent Transfer, Windows Update Client, and Windows Media® Center, use the new start type to help improve the performance of logons after a boot.

As you can see, they set various Windows services to use this by default. So, should you use it? And in development or production?

Could be great for development

I can see it being very useful in development, especially. Imagine you want to have certain services running (like CF) but you don't care if they start immediately. Setting them to delayed means your machine can start up faster, and when you do eventually need what the service offers, it should be running.

(Yes, I realize you can start CF manually from the command line instead, and some may prefer that as their means of running CF in development. That's not the point here, though. And I also realize one can even start any window service via shortcuts as well, so as to start them manually. I use that to stop and then start them (rather than open services to restart them if I do it often, as I might with CF during development). I'm still not preferring to run CF from the command line by default, so let's let that debate go. )

I'm just saying that if you do want CF or other services started as services, but you don't really need them running immediately on restart, this seems a good option.

For now, I've enabled it for my two CF services (7 and 8), and their related search and ODBC services, and SQL Server and related services (I've already set MySQL and Oracle to start as "manual" as I use them less frequently), and IIS (world wide publishing service).

Any drawbacks? Time will tell

I say above that it "seems a good option" and "could be great" (and I mention it for development primarily) because I could see a possible problem where the lower disk, cpu, and memory priority could have some unintended consequences if in fact CF requests were to start coming in immediately upon start of CF. Again, perhaps in development this isn't an issue but it's something to keep in mind--and especially for production.

I could just see some admin deeming CF perhaps to be "not as important" as some other services on the machine and so they might set CF for this delayed start. If they don't realize this throttling that happens during service startup in this mode (and its not obvious), I could see it causing problems.

I'll say this bears paying attention to for any who perform troubleshooting on a CF server, if there are any problems during startup. It will now be one of the first things I look into when someone reports problems with CF on startup.

(I won't go so far as to suggest it's had anything to do with the problems some have had with initialization of CF due to JVM 1.6. Since it seems those were indeed solved by going back to 1.5, it doesn't appear it could have been due to this instead.)

There are some other interesting new features in Vista and 2k8 regarding services, especially "Preshutdown Notification". I may write more about those in a future entry.

And if anyone would want to snipe that their OS has long had features like the above, please, save it. :-) I'm here to help those who want or have to choose to use Windows. This isn't the place to try to evangelize them away or to carp about how they are or have been missing out. Thanks.

For more content like this from Charlie Arehart: Need more help with problems?
  • If you may prefer direct help, rather than digging around here/elsewhere or via comments, he can help via his online consulting services
  • See that page for more on how he can help a) over the web, safely and securely, b) usually very quickly, c) teaching you along the way, and d) with satisfaction guaranteed
Comments
That is very cool, Charlie. It's one reason to like the fact that I won a copy of Vista Ultimate at CFUnited. :) Because it does get frustrating when you login to your machine, you can see the desktop, but there are still services starting that slow everyting down for a while. I hope this works as well as advertised.
Just a follow up to this, in case someone gets burned by it. You may find you get this error: "The process cannot access the file because it is being used by another process." If you look at the list of what's taking up ports, such as NETSTAT -ano, or a tool like active ports or curports, you'll see that something else has grabbed port 80. In my case, it was Skype, and I'm guessing my problem was that I had set IIS (world wide web publishing service) to delayed start.

I did some digging and see that if port 80 is free when Skype starts, it will grab it (and 443). This is to help those using Skype who work in environments where they can't open a firewall hole for it. You can stop Skype doing that by going to tools>options>advanced>connection> and disable "user port 80 and 443 as alternatives for incoming connections".

I've just changed that and will check things out and report back if for some reason things aren't resolved after a test of a restart.

Other programs do this, too, grabbing port 80, so if you get the error above with IIS, find out what's using it and stop it, or change the IIS service back to not being "delayed start".
The "KService" used by Channel Four and by Sky Online also grabs Port 80, and doesn't appear to mhave a configuration dialogue to change it.
Kenneth Spencer
(UK)
# Posted By Kenneth Spencer | 12/20/09 10:38 AM
Copyright ©2024 Charlie Arehart
Carehart Logo
BlogCFC was created by Raymond Camden. This blog is running version 5.005.
(Want to validate the html in this page?)

Managed Hosting Services provided by
Managed Dedicated Hosting