Windows Server performance: find the bottleneck and the process

“The server is slow” is about the vaguest ticket you can get. Windows Server performance troubleshooting turns it into a number: which resource is busy (CPU, memory, disk or network), how busy it is, and which process is behind it.

You’ll build a quick performance snapshot, then put load on the CPU, memory and disk on purpose and watch the right counters move, and finally record a trace with Windows Performance Recorder for a deeper look.

TimeYou needBy the end you can
About 90 minutesSRV01 with the D: data disk, and internet access for one downloadFind the bottleneck resource and the process behind it, using the counters that matter

What it is, in one line

Windows Server performance troubleshooting means measuring the four resources (CPU, memory, disk, network) against known healthy values, so you can find which one is the bottleneck and which process is causing it.

In Simple Words

In Simple Words

Think of a school canteen at lunchtime. If the queue is long, it might be because there’s only one cook, or the fridge is too small, or the plates come back slowly from the washing area, or the door is too narrow. Hiring more cooks won’t help if the plates are the problem, so first you watch where the students are standing and waiting. A slow server is no different: find out where the work is waiting before you throw more CPU or memory at it.

Engineer's View

Engineer’s View

CPU: if % Processor Time stays above about 80% for long stretches and Processor Queue Length sits above 2 per core, work is waiting for the CPU. Look at Process(*)\% Processor Time to find the culprit, and at % Privileged Time for driver or kernel work.

Memory: Available MBytes below about 10% of RAM, a high Pages Input/sec (hard faults read from disk) and % Committed Bytes In Use close to 100% all point to memory pressure. A process whose Private Bytes only ever goes up is probably leaking.

Disk: latency is what counts. For Avg. Disk sec/Read and /Write, under 10 ms is good, 10 to 20 ms is OK and anything over 20 ms for a sustained period is slow. Queue length and IOPS only mean something when you read them next to latency.

Network: compare Bytes Total/sec against the link speed and keep an eye on Output Queue Length. Retransmits usually point to packet loss and not to a bandwidth limit.

Tools: Task Manager and Resource Monitor give you a live view, Get-Counter and PerfMon give you numbers over time, and Windows Performance Recorder (wpr) together with Windows Performance Analyzer gives you a deep trace of what each thread was doing.

How it works, step by step

The four resources and the counters to check first:

Windows Server performance counters for CPU, memory, disk and network

Always begin with a short snapshot of all four resources, because a server at 100% CPU might really be short of memory, paging hard and burning its CPU on the paging.

Compare what you see with a baseline (Lesson 39). 60% CPU is fine on a server that always runs at 60%, but it’s a warning sign on one that normally sits at 10%.

Once you know which resource it is, find the process, and then ask why: more users, a new job, a bad update or a leak.

Symptom, likely bottleneck and the tool to confirm it:

Windows Server performance method: snapshot, compare, resource, process, cause and trace

You’ll do the whole lab on SRV01:

  • Build a Get-PerfSnapshot function.
  • Load the CPU and find the busy process.
  • Use up memory and watch Available MBytes.
  • Load the disk with DiskSpd and read the latency.
  • Record a short trace with Windows Performance Recorder.

Hands-on lab: load each resource and measure it

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Start DC01 and SRV01, and give SRV01 at least 2 vCPUs and 4 GB RAM for this lab. Work on SRV01 as SAATLAB\adm.rahul in PowerShell as administrator.

1Build a performance snapshot

Save this as C:\Lab\Get-PerfSnapshot.ps1 and load it:

function Get-PerfSnapshot {
    param([int]$Seconds = 10)
    $counters = '\Processor(_Total)\% Processor Time',
                '\System\Processor Queue Length',
                '\Memory\Available MBytes',
                '\Memory\% Committed Bytes In Use',
                '\Memory\Pages Input/sec',
                '\PhysicalDisk(_Total)\Avg. Disk sec/Read',
                '\PhysicalDisk(_Total)\Avg. Disk sec/Write',
                '\Network Interface(*)\Bytes Total/sec'
    $data = Get-Counter -Counter $counters -SampleInterval 1 -MaxSamples $Seconds
    $data.CounterSamples | Group-Object Path | ForEach-Object {
        $avg = ($_.Group | Measure-Object CookedValue -Average).Average
        if ($_.Name -like '*disk sec*') { $avg = $avg * 1000 }
        [pscustomobject]@{
            Counter = ($_.Name -split '\\')[-2..-1] -join '\'
            Average = [math]::Round($avg, 1)
        }
    }
}

. C:\Lab\Get-PerfSnapshot.ps1
Get-PerfSnapshot

You’ll see something like this:

Counter                                                                 Average
-------                                                                 -------
processor(_total)\% processor time                                          3.2
system\processor queue length                                                 0
memory\available mbytes                                                    2214
memory\% committed bytes in use                                            38.6
memory\pages input/sec                                                      0.4
physicaldisk(_total)\avg. disk sec/read                                     0.6
physicaldisk(_total)\avg. disk sec/write                                    1.1
network interface(intel[r] pro_1000 mt desktop adapter)\bytes total/sec  1288.4

This is SRV01 sitting idle: low CPU, no queue, lots of free memory and disk latency of around 1 ms (shown in milliseconds). Keep this output, because it’s your quick baseline for the next steps.

✅ Checkpoint: Get-PerfSnapshot prints averages for CPU, memory, disk latency (ms) and network.

2Load the CPU and find the busy process

Start two busy loops (one for each vCPU), take a measurement, and then find the top process:

$jobs = 1..2 | ForEach-Object { Start-Job { while ($true) { } } }
Get-PerfSnapshot -Seconds 5 | Where-Object Counter -like '*processor*'
(Get-Counter '\Process(*)\% Processor Time').CounterSamples |
    Where-Object { $_.InstanceName -notin '_total', 'idle' } |
    Sort-Object CookedValue -Descending | Select-Object -First 3 InstanceName,
        @{ n = 'CPU'; e = { [math]::Round($_.CookedValue) } }

You’ll see something like this:

Counter                            Average
-------                            -------
processor(_total)\% processor time    99.6
system\processor queue length          4.2

InstanceName CPU
------------ ---
powershell   100
powershell#1  99
wmiprvse       2

The CPU is maxed out and work is queueing. The per-process counter counts 100% per core, so two processes at about 100 each are enough to fill two vCPUs, and at work your next move would be to map that process to a service or a user.

Stop the load:

$jobs | Stop-Job -PassThru | Remove-Job

✅ Checkpoint: CPU was near 100% with a queue, and two powershell processes were the top consumers.

Windows Server performance lab: CPU at 100% with a processor queue
Windows Server performance: CPU pegged, threads queueing, and the processes responsible

3Use up memory and watch it

Allocate and touch about 1.5 GB, and then take a snapshot:

$a = New-Object byte[] 1.5GB
for ($i = 0; $i -lt $a.Length; $i += 4096) { $a[$i] = 1 }
Get-PerfSnapshot -Seconds 5 | Where-Object Counter -like 'memory*'
Get-Process -Id $PID | Select-Object Name, @{ n = 'PrivateMB'; e = { [math]::Round($_.PrivateMemorySize64 / 1MB) } }

You’ll see something like this:

Counter                         Average
-------                         -------
memory\available mbytes             672
memory\% committed bytes in use    76.9
memory\pages input/sec             18.3

Name       PrivateMB
----       ---------
powershell      1611

Available memory fell by about 1.5 GB, commit went up, and Windows started reading pages back from disk. Touching each 4 KB page is what makes this work, because Windows only hands a process real RAM once it uses the memory.

Release it:

Remove-Variable a; [GC]::Collect()

✅ Checkpoint: Available MBytes fell and PowerShell’s private memory rose by about 1.5 GB, then recovered.

4Load the disk with DiskSpd and read latency

Download DiskSpd from Microsoft’s GitHub and run a 30-second random test against D:

New-Item C:\DISKSPD -ItemType Directory -Force | Out-Null
Invoke-RestMethod -Uri https://github.com/microsoft/diskspd/releases/latest/download/DiskSpd.zip -OutFile C:\DISKSPD\DiskSpd.zip
Expand-Archive C:\DISKSPD\DiskSpd.zip -DestinationPath C:\DISKSPD -Force
C:\DISKSPD\amd64\diskspd.exe -c1G -d30 -t2 -o16 -b8K -r -w30 -Sh -L D:\diskspd-test.dat |
    Select-String 'total:' | Select-Object -First 1

While that’s running, take a snapshot from a second window. You’ll see something like this:

Counter                                  Average
-------                                  -------
physicaldisk(_total)\avg. disk sec/read     14.8
physicaldisk(_total)\avg. disk sec/write    22.5

total:   1312022528 |    160159 |      41.71 |    5338.63 |    5.993 |    11.422 | D:\diskspd-test.dat (1024MiB)

The DiskSpd total line gives you bytes, I/Os, MiB/s, IOPS, the average latency in ms and its standard deviation. Numbers jump around a lot on a laptop, so focus on the fact that latency went from about 1 ms to 15 to 20 ms under load, which users would definitely feel.

Clean up:

Remove-Item D:\diskspd-test.dat

✅ Checkpoint: Disk latency rose clearly during the DiskSpd run, and the test file is deleted.

5Record a trace with Windows Performance Recorder

Record 20 seconds of general activity while the CPU is kept busy:

$job = Start-Job { while ($true) { } }
wpr -start GeneralProfile -filemode
Start-Sleep -Seconds 20
wpr -stop C:\Lab\perf.etl
Stop-Job $job; Remove-Job $job
Get-Item C:\Lab\perf.etl | Select-Object Name, @{ n = 'MB'; e = { [math]::Round($_.Length / 1MB) } }

You’ll see something like this:

Name      MB
----      --
perf.etl 212

Copy perf.etl to your laptop and open it in Windows Performance Analyzer (it’s part of the Windows ADK and also in the Microsoft Store). The CPU Usage (Sampled) graph shows which process, module and even function was using the CPU. [Add your screenshot here]

✅ Checkpoint: wpr created C:\Lab\perf.etl and you can open it in WPA.

Break It, Then Fix It

You’ll meet both of these for real: a process that slowly eats memory, and a server that doesn’t have enough CPUs for the work it’s given.

1Break it: start a memory leak

On SRV01, start a job that grabs another 10 MB of memory every half second and never gives it back:

$leak = Start-Job {
    $list = New-Object System.Collections.ArrayList
    while ($true) { [void]$list.Add((New-Object byte[] 10MB)); Start-Sleep -Milliseconds 500 }
}
1..3 | ForEach-Object {
    Start-Sleep -Seconds 10
    Get-Process powershell | Sort-Object PrivateMemorySize64 -Descending | Select-Object -First 1 Id,
        @{ n = 'PrivateMB'; e = { [math]::Round($_.PrivateMemorySize64 / 1MB) } }
}

You’ll see something like this:

  Id PrivateMB
  -- ---------
5120       262
5120       463
5120       664
Windows Server performance break lab: private memory growing steadily in a leak
A leak: private memory climbs in a straight line and never comes down

The same process grows by about 200 MB every 10 seconds and never shrinks, and Private Bytes climbing in a straight line whatever the load is the classic sign of a leak. If you leave it, commit reaches 100%, Windows logs “low on virtual memory” warnings (Resource-Exhaustion-Detector event 2004) and other apps start failing.

To fix it, stop the leaking process and set up an early warning for next time:

$leak | Stop-Job -PassThru | Remove-Job
Get-PerfSnapshot -Seconds 3 | Where-Object Counter -like '*committed*'

You’ll see something like this:

Counter                         Average
-------                         -------
memory\% committed bytes in use    39.1

At work the real fix is a vendor patch, or a scheduled restart of the service until the patch arrives. The early warning is a Data Collector Set alert (Lesson 39) on Process Private Bytes or % Committed Bytes In Use.

✅ Checkpoint: Private memory grew steadily while the job ran and commit dropped back after stopping it.

2Break it: run the CPU test with one vCPU

Shut down SRV01, change it to one vCPU on your laptop, and start it again:

VBoxManage modifyvm SRV01 --cpus 1
VBoxManage startvm SRV01 --type headless

On SRV01, run the same two-job CPU test you used in lab step 2:

. C:\Lab\Get-PerfSnapshot.ps1
$jobs = 1..2 | ForEach-Object { Start-Job { while ($true) { } } }
Get-PerfSnapshot -Seconds 5 | Where-Object Counter -like '*processor*'
Measure-Command { Get-ChildItem C:\Windows\System32 | Out-Null } | Select-Object TotalSeconds
$jobs | Stop-Job -PassThru | Remove-Job

You’ll see something like this:

Counter                            Average
-------                            -------
processor(_total)\% processor time     100
system\processor queue length          9.6

TotalSeconds
------------
        3.84

With one vCPU the queue gets much longer and even a simple directory listing takes seconds, and every other service on the server (DHCP, IIS, RDS) has to wait as well. When the CPU is busy because the work is real and expected, the answer is more capacity and not tuning.

To fix it, shut down SRV01, give it its two vCPUs back and start it up:

VBoxManage modifyvm SRV01 --cpus 2
VBoxManage startvm SRV01 --type headless

✅ Checkpoint: With one vCPU the queue length and response time were much worse than with two.

This happened at work

Out of memory with 40% of RAM unused

A file server started refusing new SMB connections every few weeks. Users got “not enough server storage is available”, yet Task Manager showed 40% of RAM unused and the CPU was low, and a restart made it go away for another few weeks. The real clue was in the System log all along: event 2019, “The server was unable to allocate from the system nonpaged pool because the pool was empty.” Nonpaged pool is kernel memory that can never be paged out, and on this server it had grown to several gigabytes. The team ran poolmon from the Windows Driver Kit and found one pool tag that kept on growing, which belonged to an old file-filter driver from a backup agent nobody used any more.

The fix: the team removed the agent and added a counter alert on Memory\Pool Nonpaged Bytes, which now warns them well before the pool runs out.

The lesson: “available RAM” doesn’t tell the whole story, so check the kernel pools and commit as well as Available MBytes.

Common mistakes and troubleshooting

MistakeWhat happensWhat to do instead
Looking at CPU onlyMemory or disk problems are missedSnapshot all four resources first
Judging disks by queue length aloneWrong conclusions on modern storageUse latency (Avg. Disk sec/Read and /Write)
Panicking at low available RAMWindows uses spare RAM as cacheCheck Available MBytes, commit and hard faults together
Adding RAM to fix a leakThe leak just takes longerFind the process with ever-growing Private Bytes
Measuring onceA spike looks like a trendSample over time and compare with a baseline
Testing disks on production dataRisk and wrong numbersUse a test file with DiskSpd, then delete it
Ignoring the hypervisorHost contention looks like a guest problemCheck host CPU ready, memory and storage too
Leaving traces runningHuge files, extra loadStop wpr and delete old traces

Interview questions

Click a question to open it. Each one is worded the way an interviewer would ask it, and underneath you’ll see why they ask and one way you could answer in your own words.

Fresher level

1. Someone tells you a server is slow. What do you check first?

Why they ask this: They want to see you have a method and look at the whole picture before blaming one thing.

How you might answer: I look at CPU, memory, disk and network together, with Task Manager, Resource Monitor or Get-Counter, to see which resource is under pressure. Then I find the top process using that resource.

2. What does the Processor Queue Length counter tell you?

Why they ask this: They want to know you understand the key CPU counters and don’t stop at the percentage.

How you might answer: It shows how many threads are waiting for the CPU. A short spike is normal, but if it stays above about 2 per core for a long time, the CPU really is the bottleneck.

3. How would you explain what good disk latency looks like to a new team member?

Why they ask this: They’re checking you know the basic numbers for storage performance.

How you might answer: I’d tell them under 10 ms is good and 10 to 20 ms is OK, and if it stays over 20 ms that’s slow for most workloads. I’d also tell them to look at the trend over time and not trust one reading.

2–5 years experience

4. An application server gets slower every week until someone restarts it. How would you check for a memory leak?

Why they ask this: They want to see you read trends over time instead of looking at one moment.

How you might answer: I’d watch the Private Bytes counter for each process over hours or days, because a leak shows up as one process growing steadily whatever the load is, and often the system commit charge climbs with it. Once I know which process it is, I can go to the app owner with the data.

5. Task Manager shows almost no free memory on a server. Is that a problem?

Why they ask this: They want to know you understand how Windows uses memory, so you don’t raise false alarms.

How you might answer: Not on its own. Windows uses spare RAM as cache, so low free memory is normal. I’d look at Available MBytes, the commit charge, hard faults with Pages Input/sec and paging activity, and if those look fine, the server isn’t short of memory.

6. You want to test how fast a new storage system is. How would you do it safely?

Why they ask this: They want to see you know DiskSpd and test carefully without hurting other workloads.

How you might answer: I’d use DiskSpd with a test file and set the block size, the read and write mix, the number of threads and the queue depth to match the real workload. I’d run it out of hours and then compare the results with the vendor’s numbers.

Senior level

7. CPU is at 90 percent, but no process in Task Manager looks busy. What would you do next?

Why they ask this: They want to see you can dig deeper than Task Manager when the obvious answer isn’t there.

How you might answer: First I’d check % Privileged Time and the DPC and interrupt time counters, because high numbers there point to the kernel or a driver. Then I’d record a trace with WPR and open it in WPA to see CPU usage by module, and very often it turns out to be a driver.

8. A team asks you how big a server they need for a new application. How would you work it out?

Why they ask this: They want to see you size servers from real data and not from guesses.

How you might answer: I’d baseline a test run of the app and measure the peak for each resource, then add room for growth and some headroom, say 30 percent. If it’s going to be a VM, I’d also make sure the hypervisor host has the capacity.

9. What is nonpaged pool, and why should a server admin care about it?

Why they ask this: They want to know you understand kernel memory and a failure that confuses a lot of people.

How you might answer: Nonpaged pool is kernel memory that can’t be paged out to disk. If a driver leaks memory there, you get event 2019 and failures even when the server has plenty of RAM, and I’d use poolmon to find the growing pool tag, which points me to the driver.

Quick quiz

Q1. Which counter best shows a slow disk?

  1. % Idle Time
  2. Avg. Disk sec/Read and /Write
  3. Disk Bytes/sec
Show answer

B — Latency is what users feel.

Q2. What does a Processor Queue Length of 9 on one CPU mean?

  1. Normal
  2. Many threads are waiting for CPU
  3. The disk is slow
Show answer

B — Above 2 per core sustained is a bottleneck.

Q3. Why did the lab touch every 4 KB page?

  1. To make it slower
  2. Windows only gives real RAM when memory is used
  3. To test the disk
Show answer

B — Commit alone doesn’t use RAM.

Q4. What is the signature of a memory leak?

  1. CPU at 100%
  2. Private Bytes growing steadily
  3. Low network traffic
Show answer

B — It never shrinks.

Q5. What did event 2019 point to in the work story?

  1. A full disk
  2. An empty nonpaged pool
  3. DNS failure
Show answer

B — A driver leaked kernel memory.

Quick recap

  • Windows Server performance work always starts by looking at all four resources: CPU, memory, disk and network.
  • Key counters: % Processor Time, Processor Queue Length, Available MBytes, % Committed Bytes In Use, Avg. Disk sec/Read and /Write.
  • Find the process behind the load, then work out why it changed.
  • DiskSpd measures storage; wpr and WPA show what threads were doing.
  • A leak shows up as Private Bytes or pool memory that only ever grows.

Next lesson

Lesson 48: Boot failures and crashes → Next you’ll bring back a server that won’t start using WinRE and bcdedit, set up crash dumps, and read a blue screen dump with WinDbg.

Further reading: Windows Server performance

Want to go deeper into Windows Server performance? Microsoft’s performance tuning guidelines for Windows Server cover each role, and the DiskSpd guide explains every storage test option. You can also see the full plan for this course on the Windows Server Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.