Which of these scenarios is worse? A computer that takes an inordinate amount of time to:
- Start up or
- Shut down?
Okay, I guess that’s like asking which is worse: a slow computer or a capricious computer? In other words, both equally suck and one isn’t really any less annoying than the other.
But this is the thing: When my computer takes ages to shutdown it tempts me to my hold in the power button to force off the power.
I don’t want to wait for the computer to turn off – when I’m done with my PC for the day it shouldn’t merely acquiesce to my shutdown request; no on the contrary it should execute my commands with alacrity and turn itself off in a matter of seconds.
If your PC chronically founders when you tell it to power down then we need to find out why it founders. Is there an easy way to identify the programs or processes that are making a speedy shutdown futile?
Identifying the culprit
One of the most reliable means of identifying aberrant processes is using a free toolkit from Microsoft called the Windows Performance Toolkit which is part of a large software package known as the Windows Software Developer’s Kit (SDK).
I know “Software Developer’s Kit” may sound grandiloquent or even daunting, especially if you’re not a software developer; however, we’re not going to touch a single bit of code.
While it’s true that Windows developers use the SDK to compile and test code; today we’re only going to analyze some data values so we can figure out what’s bothering your hapless computer.
Installing the SDK
First we need to download the right SDK.
Since I’m running Windows 8.1, I’ll demonstration how I got this thing going my OS. Click open the executable named sdksetup.exe and keep the default installation location.
You might notice the setup wizard requires a glut of space; at one and a half gigs this thing looks like a beast.
Fortunately on the third setup screen you’ll have the option to disable superfluous items. I’ll show you that a little later.
On the next screen, opt out of the Customer Experience Improvement Program.
Microsoft has enough information about me, anonymous or not, thus I don’t feel compelled to give up anything else.
Accept the license agreement…
The Software Development Kit comes chock full with a bunch of software libraries that aren’t really germane to what we’re trying to do; therefore, go ahead and un-check everything except the Windows Performance Toolkit.
In the right pane you’ll see it includes:
- Windows Performance Recorder
- Windows Performance Analyzer
That second guy there, Windows Performance Analyzer (WPA), is our ticket to shutdown speediness. I’m going to show you how to use WPA, and his cousin Xbootmgr, to get to the bottom of the problem.
Click Install and you’ll be finished in 60 seconds.
Alright, now we’re done with the boring stuff.
Press Windows Key + x + a to open a Command prompt with Administrative privileges and navigate to the Windows Performance Toolkit folder.
Type this in:
cd \ cd "Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit"
Alright now save the changes from any documents, spreadsheets or projects you were working on and paste in the following cryptic command:
xbootmgr -trace shutdown -traceFlags BASE+DIAG+LATENCY -noPrepReboot
This tells Windows to trace the shutdown process and to do it immediately after you press the Enter key.
You should see a starting trace dialog box flash on the screen for an instant before your computer reboots itself.
When it returns you’ll see something like this:
The trace you are capturing "C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\shutdown_BASE+DIAG+LATENCY_1.etl" may contain personally identifiable information
That’s good as it denotes the trace completed successfully.
Go ahead and open the Windows Performance Toolkit folder and then drag the trace file, which should be named shutdown_BASE+DIAG+LATENCY_1.etl, over the Windows Performance Analyzer file named wpa.exe.
This slick move forces the Windows Performance Analyzer to load all the trace data from the .ETL capture.
When it loads you should see a few items in the Graph Explorer sitting in the left pane:
- System Activity
- Computation analytics
- Storage statistics
- Memory facts
- Power data points
I know this sounds crazy but you don’t need a Masters in Statistics to analyze the data here.
Let me walk you through how easy it is to find the processes that could be slowing down your shutdowns…
In the Graph Explorer, click open Storage, expand Disk Usage and double-click Service Time by Process, Path Name, Stack.
A bunch of data will take over your screen. Let me break it down a little:
We can divide the right pane into two sections:
The top half lists your system processes and displays a graph that lists each process by how long it took to close (the horizontal axis) and how much memory was consumed at each time interval (the vertical axis).
The bottom half shows all your processes, the file path to the process file and the all important Disk Service Time column.
I want you to focus on this bottom pane.
The Disk Service Time column shows time values in millionths of a second, Microseconds.
So to see how long a particular process took to terminate just divide it by 1 million… just kick over the decimal point 6 places to the left to get seconds.
Since the column is Disk Service Time column is sorted with the longest close times listed first, I can start marching down the list to see the slowest processes.
In my example, I can see something called MsMpEng.exe took 257,250 microseconds to close. That comes out to .2 seconds, which is paltry I know – but that’s besides the point. I just wanted you to see where to go when you need to hunt down those slow processes.
If you click the little drop down arrow under the process name you’ll see even more data such as the human friendly name of the process in the file path. Here, it looks like Windows Defender was nibbling on 56,254 microseconds of close time.
When you locate the offending process you can Google around to see if you need it and can then disable or uninstall it.
The Bottom Line
If your computer takes forever to shutdown then we use a broad stroke and start indiscriminately removing software or we can try a focused approach using the Windows Performance Analyzer.
It takes a little more work than uninstalling random files you think are responsible for the problem but it’ll give you value insights and empirical data to support your assumptions and justify your actions.
The Windows Performance Analyzer isn’t perfect and can be hard to decipher; however, if you give it a chance and it’ll reward you by helping you identify processes which are slowing down your shutdowns.
If you have any questions please share in the comments!