Configuring Services to Reduce Boot Time

Forums Operating Systems Windows Server 2008 R2 Miscellaneous Configuring Services to Reduce Boot Time

Viewing 17 reply threads
  • Author
    Posts
    • #51605

      Well I’ve completed my testing and here’s my results:

      Normal startup under MSCONFIG: 42.650 seconds
      Normal startup w/tweaked settings: 29.472 seconds

      Times according to PC Boot Timer.

      The features I had installed before performing this test were: .NET Framework 3.5, Desktop Experience, Windows Server Backup, Wireless LAN.

      Windows Aero was enabled using the default 7 theme.

      I have run similar settings under my 32-bit server 2008 box with better results but both OS showed noticeable improvements.

      How to apply my tweak

      Download the zipped folder (attached below). Extract the contents. Inside you will find serviceson.bat, servicesoff.bat, restoreservices.bat.

      Create a logoff and logon policy with the servicesoff.bat and serviceson.bat

      Start > gpedit.msc > User Configuration > Windows Settings > Scripts (logon/logoff)

      Click Logoff.

      Click Add…

      in script name type in the path of the servicesoff.bat file. I placed serviceson and servicesoff.bat in my system32 folder so my path for logoff would be c:windowssystem32servicesoff.bat

      Repeat this same process for logon except name you will use the path c:windowssystem32serviceson.bat

      What is restoreservices.bat?

      Restoreservices.bat is a fail-safe I have written that changes all of services on the machine back to its original factory setting. If you for some reason feel that the tweak is nothing benefiting your particular machine (which can be possible because this tweak is meant for dual-core and up machines) you can easily remove it by removing the logoff and logon scripts and launching restoreservices.bat. Then simply restart and you are back to the way you were before you applied my tweak!

      What did you like about this tweak?

      Mostly the fact that it shaved close to 15 seconds off my boot time. Another plus is that you do not sacrifice the operations of any services on your computer. After your machine has booted to the desktop, within the first 5 minutes your machine is operating as if you never turned anything off. The only difference is we are delaying the critical services that are causing your increased boot time, then starting the services AFTER windows starts.

      Why not just change the service to Automatic (delayed start)?

      This is a possibility and if you change the services to delayed start you will still see the same desired results. My problem with this setting is that it delays your services for 2 minutes. One of the services I have disabled which eats boot time is Security Accounts Manager which is a parent service that is required to run Network and Sharing Center. If you wish to run network and sharing center, you have to wait a few minutes. The disabling and re-enabling method is able to process the services faster for some reason.

      How does your tweak restore all my services to normal?

      I have reviewed these scripts over many of times for spelling and grammar mistakes and especially to make sure that all of the dependent services are launched BEFORE the child services. For example if you launch Task Scheduler before Windows Event Log, the service will change to automatic but it will not start because the service it depends on (event log) has not been started first. I went through each line on the script to make sure all the dependencies were met.

      What do you not like about your tweak?

      It’s really hardware dependent. If you have a machine with a 5400 RPM HDD for example and a 1GB of RAM with a low end dual core CPU, the batch processing which takes place will be a tad slower then others with higher end performance parts. Another disadvantage of the logoff script it that it takes a few seconds to process, so when you want to logoff your machine it will take a few seconds longer.

      What problems did you come across (if any) with your tweak?

      I followed a strict pattern of how I approached this tweak. I set a strict guideline on how I ran everything for example I decided to keep MSCONFIG out of the picture. It was for good reason. I come to find out that after testing (which was successful) i decided to disable some useless services via the msconfig method. For some reason this broke the integrity of my script and my boot time skyrocketed (48 seconds)! I’m not sure if Windows got confused on whether or not MSCONFIG was handing the startup of the service or my script. Or it could have been that they were both trying to process at same time which caused the lengthy boot time. I decided to re-install R2 again and re-apply my tweak to the previous method I had used. By disregarding MSCONFIG I was able to achieve consistency with the boot time.

      What should I know before removing this tweak?

      If you decide to return back to your original configuration or would like to use the MSCONFIG method again it is important that you follow the below procedure in this exact order or you risk breaking the integrity of your server (like I did πŸ˜† ). I was able to catch my error so as long as you follow the procedure…IN ORDER!!!… you should have no problems at all.

      Step 1: Remove logoff and logon scripts from Group Policy.
      Step 2: Reboot
      Step 3: Launch restoreservices.bat
      Step 4: Reboot
      Step 5: Start MSCONFIG, go to services tab. Click disable all. Apply and restart.
      Step 6: Start MSCONFIG, go to services tab. Click on enable all. Apply and restart.

      To give you an idea how much of a marked improvement this tweak has been on my 32-bit Server 2008 machine I have set up a few scenarios to demonstrate. With the help of eBoostr and my tweak i was able to achieve some sick results.

      I edited my logon script to launch a variety of applications on startup.

      In my first scenario: Chrome, Notepad, Calculator, WMP, Powerpoint, Word, Excel were all launched. The up time showed 29 seconds.

      In my second scenario I launched 25 instances of Internet Explorer. The up time showed 34 seconds. Impressed?!

      In my third scenario I launched 100 instances of notepad. The up time showed 30 seconds. Nice huh?

      For those willing to try out my tweak, follow my recommendations below so we can provide a benchmarking comparison of everyones machine to see how much of an effect it is having.

      1. Download PC Boot Timer: http://download.cnet.com/PC-Boot-Timer/3000-2094_4-10545234.html

      2. Run PC Boot Timer with all your services enabled (before tweak).

      3. Record your boot time.

      4. Apply the tweak above and re-run PC Boot Timer again.

      5. Record your new boot time.

      Kind of like I did at the way top of this post. Sort of like a before and after snapshot.

    • #51606
      Arris
      Moderator

      You keep amazing me with your benchmarks, tricks and guides! :geek: Great job! πŸ™‚ I added a link to this topic at the Fine-Tuning Services in the Windows Server 2008 manual. 😎

    • #51608

      @Arris wrote:

      You keep amazing me with your benchmarks, tricks and guides! :geek: Great job! πŸ™‚ I added a link to this topic at the Fine-Tuning Services in the Windows Server 2008 manual. 😎 I also moved your topic to the non-R2 section because it seems you currently only tested it on Windows Server 2008.

      Hi, Arris

      Thanks! The tweak I provided was configured around a Server 2008 R2 installation as evidenced by the RPC Endpoint Mapper (rpceptmapper) service in the script (not available on 2008). I have a similar script on my 2008 box, which for some reason is the fastest for me. To give you an example i used the same eboostr program on R2 and even though it booted up in 25 seconds (2 seconds faster than 2008) it took a little while to load IE. The machine booted up in 25 seconds, but IE didn’t load until 36 seconds. On Server 2008 it loads almost instantly. IE is just not the only example… Word, Excel, Powerpoint, WMP, Chrome all load slower as the machine is booting up. HOWEVER if I let both machines idle for a few minutes and then launch these same programs…the startup time is the same. I like my server 2008 box because its ready to go right now.

    • #51609

      I figured out what was causing my abnormal boot time when configuring with MSCONFIG. Turns out that Windows was setting my logon script to run synchronously. In other Windows Explorer will not start until the script is finished running. We don’t want that.

      If this ever happens to you, go to User Configuration > Administrative Templates > System > Scripts > Run logon scripts synchronously

      Disable it.

      I was able to tweak my 2008 box even further by turning on some more services that I don’t need. Check out this boot time!

      Every day when I wake up I power on my desktop and head to the bathroom. When I am done peeing I sit back down on my chair and wait for the remainder of Server to load. Now Server is already loaded. I can’t pee faster than Server can load! πŸ˜† Gotta love Server 2008.

    • #51607
      Arris
      Moderator

      @halladayrules wrote:

      Thanks! The tweak I provided was configured around a Server 2008 R2 installation as evidenced by the RPC Endpoint Mapper (rpceptmapper) service in the script (not available on 2008).

      Ah, I see πŸ™‚ Moved your topic back to the R2 forum, and moved the reference from the Services page in the 2008 manual to the front page of the R2 manual. πŸ˜‰

      @halladayrules wrote:

      I have a similar script on my 2008 box, which for some reason is the fastest for me. To give you an example i used the same eboostr program on R2 and even though it booted up in 25 seconds (2 seconds faster than 2008) it took a little while to load IE. The machine booted up in 25 seconds, but IE didn’t load until 36 seconds. On Server 2008 it loads almost instantly. IE is just not the only example… Word, Excel, Powerpoint, WMP, Chrome all load slower as the machine is booting up. HOWEVER if I let both machines idle for a few minutes and then launch these same programs…the startup time is the same. I like my server 2008 box because its ready to go right now.

      Could you also post these scripts so non-R2 users are also able to quickly optimize their OS’ startup time? :geek: I will then add a direct link to the Fine-tuning Service page because this list of services is static anyway.

      @halladayrules wrote:

      Every day when I wake up I power on my desktop and head to the bathroom. When I am done peeing I sit back down on my chair and wait for the remainder of Server to load. Now Server is already loaded. I can’t pee faster than Server can load! πŸ˜† Gotta love Server 2008.

      Haha nice! :mrgreen:

    • #51610

      Nice share !

      We’ll fix those in R2ConvGUI !

      TY.

      Regards,

      N & Team 😎

    • #51611

      Hey, firstly thank you for the work with the scripts, I found them really helpful. However..

      @halladayrules wrote:

      Why not just change the service to Automatic (delayed start)?

      This is a possibility and if you change the services to delayed start you will still see the same desired results. My problem with this setting is that it delays your services for 2 minutes. One of the services I have disabled which eats boot time is Security Accounts Manager which is a parent service that is required to run Network and Sharing Center. If you wish to run network and sharing center, you have to wait a few minutes. The disabling and re-enabling method is able to process the services faster for some reason.

      .. I didn’t find this to be the case with my R2 (web server) installation? In fact, quite the opposite, when enabling the services through the bat file they would take 2 minutes to enable, but with automatic (delayed start) they would start virtually straight after logging into Windows. This is especially noticeable with Sandboxie for example, it briefly flashes an exclamation mark in the task bar to say service couldn’t be loaded which then corrects itself as the service becomes available; also with my wifi connection, it briefly flickers as if it can’t find connection and then the service kicks in and all is fine. However, with the bat for both of these services, in particular wifi isn’t available for around 2 minutes.. maybe I’m missing something?

    • #51612

      @Tigerite wrote:

      Hey, firstly thank you for the work with the scripts, I found them really helpful. However..

      @halladayrules wrote:

      Why not just change the service to Automatic (delayed start)?

      This is a possibility and if you change the services to delayed start you will still see the same desired results. My problem with this setting is that it delays your services for 2 minutes. One of the services I have disabled which eats boot time is Security Accounts Manager which is a parent service that is required to run Network and Sharing Center. If you wish to run network and sharing center, you have to wait a few minutes. The disabling and re-enabling method is able to process the services faster for some reason.

      .. I didn’t find this to be the case with my R2 (web server) installation? In fact, quite the opposite, when enabling the services through the bat file they would take 2 minutes to enable, but with automatic (delayed start) they would start virtually straight after logging into Windows. This is especially noticeable with Sandboxie for example, it briefly flashes an exclamation mark in the task bar to say service couldn’t be loaded which then corrects itself as the service becomes available; also with my wifi connection, it briefly flickers as if it can’t find connection and then the service kicks in and all is fine. However, with the bat for both of these services, in particular wifi isn’t available for around 2 minutes.. maybe I’m missing something?

      Hello Tigerite,

      Thanks for your response. The reason why I believe some of the series do not start in a timely fashion is the fact there dependencies are not started until after the machine logins. For example the Wireless LAN service which depends on Extensible Authentication Protocol is one of the services set to disabled in my tweak and even though you start it up Wireless LAN (wlansvc) remains stopped despite it set to Automatic. You are running the web edition of R2 so there might be additional services which depend on some of the services I have had you manually disable in the servicesoff.bat file. My recommendation for you is to edit the serviceson.bat file in c:windowssystem32 and manually start the services in the script at the bottom.

      1. Reboot your machine.

      2. Click on Start > Administrative Tools > Services

      3. Click on the “Startup Type” field to sort the services. Look at the Automatic field and locate the services which have been set to Automatic but are not “started”.

      4. Click on the offending service.

      5. Locate the “service name

      6. Edit the c:windowssystem32serviceson.bat file manually in notepad. Start the service by typing in the following code:

      sc start service_name; where service_name is the name located in “service name”

      Example: If the Wireless LAN Service is not started you would add the following line at the bottom of serviceson.bat

      sc start wlansvc

      Do this for all the other services that are set to “Automatic” that have not been started.

    • #51613

      I have attached below the services tweak configuration files that I use for my 2008 machine. It works on both 2008 and R2. It includes Wireless support.

    • #51604

      Hello, i have a question….Why do you use a 32 bits of windows 2008 r2 with 8 gb of memory? why you dont use 64 bits? 32 bits is better?

    • #51617

      @xeneize500 wrote:

      Hello, i have a question….Why do you use a 32 bits of windows 2008 r2 with 8 gb of memory? why you dont use 64 bits? 32 bits is better?

      Mostly due to the fact it has a lower memory footprint. Not just server 2008 but all 32-bit OS in general. I have actually switched to 64-bit server for the purpose of virtualization. 64-bit takes advantage of virtualization and I need to test out some Active Directory configurations in 2008 at the moment.

      The selling points of running 32-bit though are: Faster boot times, lower memory usage, ability to address more than 4 GB of RAM, lower hardware requirements, allow unsigned drivers.

    • #51616

      ok….and do you think that windows 2008 is better than windows 2008 r2 as workstation??……I ask because i want to install a new S.O.. My Laptop is a Core 2 duo at 2.2 Ghz, 4 gb of memory 320 gb hdd….

    • #51615

      @xeneize500 wrote:

      ok….and do you think that windows 2008 is better than windows 2008 r2 as workstation??……I ask because i want to install a new S.O.. My Laptop is a Core 2 duo at 2.2 Ghz, 4 gb of memory 320 gb hdd….

      Windows 7 takes advantage of multi-threaded machines especially in encoding and productivity. If you don’t have a 6 core AMD or a 8 thread i7 it is really not going to benefit you that much. The disadvantage of R2 is that you are forced to use 64-bit and it is a little more resource intensive than 32-bit server 2008. The great thing about 2008 is you still get to use all 4GB of your RAM and do all the daily tasks you would perform on R2. The memory footprint is quite noticeable. If you really enjoy the features of Windows 7 my personal recommendation would be to just run 7. I’m not trying to advocate that server 2008 is the greatest operating system ever or any propaganda like that – from my personal experience its just been the one that has run the best on my machine.

      Here’s a Passmark benchmark comparing 2008 64-bit to windows 7 64-bit on my machine:

      https://spreadsheets.google.com/pub?hl=en&hl=en&key=0AnOEGsd9ZH32dEJJTVo2SktVMDlDRlZpcDZIam10ZlE&output=html

      As you can see server 2008 performed quite better over 7 in 3D Graphics and Disk score for some reason.

      I can’t explain it technically, I just like it. Your best bet would be to try out R2 first for a little bit and then switch to server 2008 and feel the difference for yourself. Its the only way you are going to be for certain which one you like best. That is my advice my friend.

    • #51618

      I have recently discovered that applying this tweak will break the system restore functionality if you continue to use it. If you do not care to use system restore you can continue to use this tweak, if not I highly advise restoring your system to normal via my guide here:

      Post

      Go to “What should I know before removing this tweak?” to properly restore your system back to normal. Make sure you have downloaded the attached restoreservices.bat file.

    • #51614

      @halladayrules wrote:

      I have recently discovered that applying this tweak will break the system restore functionality if you continue to use it. If you do not care to use system restore you can continue to use this tweak, if not I highly advise restoring your system to normal via my guide here:

      Post

      Go to “What should I know before removing this tweak?” to properly restore your system back to normal. Make sure you have downloaded the attached restoreservices.bat file.

      well…. i can’t see the restoreservices.bat file.
      it’s not in the zip file… (??)

    • #51619

      Yeah bit of a problem. I didnt save a copy of that on my hard drive and i accidentally deleted it. As long as you remove the logon/logoff scripts in group policy you should be good.

      open group policy (gpedit.msc) and go to user configuration > windows settings > Scripts (logon/logoff) and remove the serviceson.bat and servicesoff.bat. You should be good to go. It will work as long as you don’t apply the tweak because the services tweak disables system restore on shutdown there damaging the restore point.

      It is attached below.

      @kaworu666 wrote:

      @halladayrules wrote:

      I have recently discovered that applying this tweak will break the system restore functionality if you continue to use it. If you do not care to use system restore you can continue to use this tweak, if not I highly advise restoring your system to normal via my guide here:

      Post

      Go to “What should I know before removing this tweak?” to properly restore your system back to normal. Make sure you have downloaded the attached restoreservices.bat file.

      well…. i can’t see the restoreservices.bat file.
      it’s not in the zip file… (??)

    • #51620

      this script is pretty cool in yr result! thx for yr sharing. i will try it out tonight~~

    • #51621

      That’s right. Most people blame system for the high boot time, without knowing what the reason behind this is. I have worked 3 years in a technical support; we always used to get calls with irate customers complaining about the login time and slow computer. When we diagnose we can understand this is because of the programs that they run, which is hard to make them understand.

    • #44188

      I have been playing around with many different configurations in MSCONFIG/services.msc in the efforts of finding an optimal boot time on my machine without sacrificing operation of services on my computer. I think a lot of us, especially the average PC user are not ‘in the know’ about what is really going on behind the kernel when Windows begins to load all these services, drivers, and programs. Most of us just assume that operating systems from Vista on up have an unusually higher boot time due to the amount of services starting up, in contrast to XP which has literally half that mark.

      I came across an interesting discovery regarding the services of my 2008 box. I noticed that even though I may have quite a large amount of processes (and services) running after my computer boots up, the truth be told that only a limited amount of services initially start up before the desktop appears. This is due to the fact that many services in Windows have dependices (i.e service #2 cannot start unless service #1 is started first). For example, MSFTPSVC depends on IISADMIN and IISADMIN depends on Security Accounts Manager.

      What I had done is the following. First I rebooted my machine and the moment the desktop appeared I launched MSCONFIG and clicked on the services tab. After that I filtered the service status for RUNNING only. With the system up time of my machine under 40 seconds I took a note of the services running. This is what I call my initial snapshot footprint:

      Here’s a list of services i found running initially:

      -Application Experience
      -Application host Helper Service
      -Windows Audio Endpoint Builder
      -Windows Audio
      -Base Filtering Engine
      -DHCP Client
      -DNS Client
      -Diagnostic Policy Service
      -Function Discovery Resource Publication
      -Windows Presentation Foundation
      -Group Policy Client
      -IKE and AuthIP IPSEC Keying Modules
      -Multimedia Class Scheduler
      -Net.tcp Port Sharing Service
      -Network Location Awareness
      -Network Store Interface Service
      -NVIDIA Driver Helper Service
      -PnkBstrA
      -IPsec Policy Agent
      -Remote Registry
      -Secondary Logon
      -Shell Hardware Detection
      -Print Spooler
      -Tablet PC Input Service
      -Themes
      -Desktop Window Manager Session
      -WebClient
      -Windows Defender

      Thats 28 services when my machine initially starts up. After my machine has loaded for 2 minutes or so the amount of services that is running on my machine goes up from 28 to 50 services. So its the not 50 services I should be focusing my attention on disabling but rather the 28 services instead. They are the “initial services” that boot up which is causing the bulk of my boot time to suffer. After this I decided to one by one experiment by manually disabling each service in MSCONFIG. After mucking around with a few services I was able to figure out what was taking up the hugest chunk of my boot time.

      The guilty culprits on my specific machine are:

      -COM+ Event System
      -Windows Event Log
      -Security Accounts Manager
      -Windows Firewall
      -System Event Notification Service
      -Windows Time
      -Windows Management Instrumentation
      -Function Discovery Provider
      -Function Discovery Resource
      -Workstation
      -Server
      -TCP/IP NETBIOS
      -MY ANTIVIRUS service (ESET)

      I created a logoff script which disables these specific services when the computer reboots these services do not run. I then creating a logon batch script which then begins to automatically load these services in the background after the desktop is loaded. The only drawback to manually loading these services after windows logins is that any service which depends on any of the above “guilty culprits” must also be manually started in my batch file as well. For example the Task Scheduler service is set to Automatic but it depends on the Windows Event Log service to be running. Even though it is set to automatic it doesn’t “automatically” run the service even after the computer has been logged on. I think this is due to the fact that I have instructed the Windows Event Log service to start AFTER the Windows Explorer/desktop has appeared. Most of the services that were set to Automatic that depended on these core intial services started up with the exception of three. I was able to figure out which services were not starting up by going to Services.msc console and filtering for “Automatic” then seeing which automatic services were not started. I added the services to manually start to end of my logon script.

      sc start iisadmin
      sc start msftpsvc
      sc start scheduler

      Keep in mind that the above configuration which I have mentioned is specific to my Server 2008 machine. Disabling my “guilty culprit services” on Server 2008 R2 will not have the same effect on your machine as you have different services running on your machine than I have on mine. For example you may have an iTunes service running via the iTunes application you downloaded earlier and this particular service just happens to be running on the initial startup.

      I plan to dual boot Windows Server 2008 R2 on my hard drive in the near future and use some detective work to find out which services are eating up the bulk of our boot time under a baseline R2 install. The idea is to find out what is eating up the bulk of our boot time BEFORE you begin to load the OS down with 3rd party softwares, Windows Updates, what not. As new services begin to appear on your computer you will be able to tell if its having an adverse effect on your boot time! For example if I tweak Server 2008 R2 to boot up in 32 seconds and you install iTunes software (iTunes service) and your boot time goes up to 38 seconds, you can pinpoint iTunes as the source of the problem. This is all in an experimental phase but I’m hoping to see some positive results from my findings!

Viewing 17 reply threads
  • You must be logged in to reply to this topic.