It covers EVERYTHING you need:
✔ What PerfMon is
✔ Why PerfMon is used
✔ When to use PerfMon
✔ PerfMon Architecture
✔ Key Terminologies
✔ How PerfMon works
✔ How to use PerfMon step-by-step
✔ All important counters
✔ Real performance engineering use cases
✔ Advantages, Limitations, Best Practices
✔ Troubleshooting with PerfMon
✔ PerfMon vs other tools
📘 PERFMON (Performance Monitor): The Complete One-Stop Tutorial
1. Introduction to PerfMon
What is PerfMon?
PerfMon (Performance Monitor) is a built-in Windows performance monitoring tool used to collect, visualize, and analyze system and application performance metrics called performance counters.
It allows you to monitor:
- CPU usage
- Memory usage
- Disk I/O
- Network traffic
- Process-level metrics
- Thread, handle, and heap usage
- .NET CLR health (GC, exceptions, JIT, threads)
- IIS / ASP.NET metrics
- SQL Server counters
- Custom application counters
PerfMon is one of the most powerful and most underutilized diagnostic tools in Windows.
2. Why PerfMon Exists (Purpose)
PerfMon helps you:
✔ Detect performance bottlenecks
CPU spikes, memory leaks, disk contention, network congestion
✔ Troubleshoot production issues
- High CPU
- Low memory
- Disk thrashing
- Network bottleneck
- Slow API response time
- GC pauses
- SQL performance issues
✔ Perform load testing diagnostics
It allows you to correlate load tests with system metrics.
✔ Monitor .NET applications
GC behavior, exceptions/sec, thread pool usage
✔ Monitor IIS / Kestrel
Requests/sec, connection queue, request pipeline health
✔ Monitor SQL Server
Batch requests/sec, compilations, cache hits
PerfMon is essential for Performance Engineering, SRE, DevOps, and Developers.
3. When to Use PerfMon (Scenarios)
Use PerfMon when:
1️⃣ You run a load test
You must capture perf counters to see:
- CPU
- Memory
- Disk
- Network
- .NET GC
- SQL Server
2️⃣ Production troubleshooting
When a server is slow, PerfMon reveals patterns.
3️⃣ Memory leaks
Watch Private Bytes + GC counters.
4️⃣ CPU spikes
Check Processor Time + Context Switches + thread count.
5️⃣ Slow disk or file reads
Disk Queue Length is key.
6️⃣ Slow API throughput
Monitor Requests/sec + ASP.NET pipeline limits.
7️⃣ High GC pauses
% Time in GC tells the story.
8️⃣ SQL Server performance issues
Batch Requests/sec + Compilations/sec.
PerfMon is used by senior engineers, SREs, DevOps, DBAs, and Performance Test Engineers.
4. PerfMon Architecture
PerfMon works on a simple architecture:
Windows Kernel + Applications
|
Performance Counters (APIs)
|
PerfMon.exe
|
- Live Graphs
- Reports
- Data Collector Sets
Key points:
- Windows exposes more than 5,000 counters.
- PerfMon reads these counters and shows them.
- Counters can come from OS, .NET CLR, SQL Server, IIS, third-party apps.
5. Key Terminology
➤ Performance Counter
A real-time metric exposed by Windows or applications.
Examples:
- % Processor Time
- Available Memory
- Disk Queue Length
- Bytes Received/sec
- .NET CLR Memory: % Time in GC
- SQL Compilations/sec
➤ Object
A category of counters, e.g.,
- Processor
- Memory
- PhysicalDisk
- Network Interface
- Process
- .NET CLR Memory
➤ Instance
A specific process or core.
Examples:
- Processor → _Total, 0, 1, 2
- Process → dotnet, chrome, myapp.exe
- SQL Server → MSSQLSERVER
➤ Data Collector Set (DCS)
A group of counters scheduled to log into a file.
Used for:
- Load tests
- Production monitoring
- Historical analysis
➤ BLG / CSV Logs
PerfMon logs stored for later analysis.
BLG is the binary format (smaller, efficient).
6. PerfMon Components
PerfMon has three major sections:
6.1 Performance Monitor (Live Graph)
Shows real-time counters as a line graph.
Great for:
- Spikes
- Bottleneck identification
- Correlation during load tests
6.2 Data Collector Sets
You can create a DCS that:
- Runs for hours/days
- Captures hundreds of counters
- Saves in BLG or CSV
Used in:
- Load testing
- Production issues
- Long-running performance tests
6.3 Reports
After a DCS completes, PerfMon auto-generates reports summarizing:
- Peak CPU
- Memory trend
- Disk latency
- Network usage
7. How to Use PerfMon (Step-by-Step Tutorial)
Step 1: Launch PerfMon
Press:
Win + R → perfmon
OR
Search: Performance Monitor
Step 2: Open “Performance Monitor”
Left panel → Monitoring Tools → Performance Monitor
You will see:
- A default red CPU line
- Live graph
Step 3: Add Counters
Click:
Green + icon → Add Counters
You will see categories like:
- Processor
- Memory
- Disk
- Network
- Process
- .NET CLR Memory
- SQLServer:*
Step 4: Select Important Counters
Choose your object → select instance → click Add.
Examples:
For CPU
Processor → % Processor Time → _Total
Process → % Processor Time → dotnet
For Memory
Memory → Available MBytes
Memory → % Committed Bytes
Process → Private Bytes → myapp.exe
Code language: CSS (css)
For Disk
PhysicalDisk → Avg. Disk Queue Length → _Total
For Network
Network Interface → Bytes Total/sec
Code language: PHP (php)
For .NET
.NET CLR Memory → % Time in GC → myapp.exe
.NET CLR Exceptions → # Exceptions/sec → myapp.exe
Code language: PHP (php)
Step 5: Analyze Graphs
Watch the graphs for:
- Spikes
- Trends
- Degradation
- Correlation with load
PerfMon lets you:
- Change line colors
- Change scale
- Pause
- Zoom in
- Pin counters
Step 6: Create Data Collector Set (DCS)
Why?
For long-term monitoring (load test, 1 hour+).
Steps:
- Right-click → Data Collector Sets → User Defined
- New → Data Collector Set
- Add performance counters
- Set sample interval (1 sec or 5 sec)
- Choose log path
- Click Finish
- Start the DCS
You now have automatic background logging.
Step 7: View Reports
After DCS completes:
Reports → User Defined → Your DCS
You will see:
- CPU peaks
- Memory trend
- Disk I/O charts
- Network summary
8. Most Important PerfMon Counters
Here are the mission-critical counters for troubleshooting.
CPU
| Counter | Why |
|---|---|
| Processor → % Processor Time | CPU bottleneck (>80%) |
| Process → % Processor Time | Per-process CPU |
| System → Context Switches/sec | Thread contention |
| Processor → % Privileged Time | Kernel overhead |
Memory
| Counter | Why |
|---|---|
| Memory → Available MBytes | Memory pressure |
| % Committed Bytes In Use | If >80% → close to paging |
| Process → Private Bytes | Memory leak indicator |
| Paging File → % Usage | Disk paging |
Disk
| Counter | Why |
|---|---|
| Avg. Disk Queue Length | Disk bottleneck if >2 per spindle |
| Avg. sec/Read | Disk read latency |
| Avg. sec/Write | Disk write latency |
Network
| Counter | Why |
|---|---|
| Bytes Total/sec | Throughput |
| Output Queue Length | NIC congestion |
| TCP Retransmissions/sec | Network issues |
.NET CLR
| Counter | Why |
|---|---|
| % Time in GC | GC pauses |
| # Gen 2 Collections | Full GCs are expensive |
| # Exceptions/sec | Exception storms |
| LOH Size | LOH fragmentation |
| Thread Count | Thread pool starvation |
ASP.NET / IIS
| Counter | Why |
|---|---|
| Requests/sec | Throughput |
| Request Execution Time | API delay |
| Current Connections | Server load |
| Pipeline Instance Count | Bottlenecks |
SQL Server
| Counter | Why |
|---|---|
| Batch Requests/sec | Query throughput |
| Compilations/sec | Poor plan caching |
| Buffer Cache Hit Ratio | Memory pressure |
| Page Life Expectancy | SQL memory issues |
9. PerfMon Use Cases
✔ Use Case 1: High CPU
Counters:
- Processor → % Processor Time
- Process → % Processor Time
- Context Switches/sec
- Thread Count
You identify:
- Hot processes
- Bad loops
- Thread contention
✔ Use Case 2: Memory Leak
Monitor:
- Private Bytes
- Working Set
- % Committed Bytes
- GC counters
✔ Use Case 3: Disk Bottleneck
Monitor:
- Disk Queue Length
- Disk latency (Avg sec/Read)
- Page File usage
✔ Use Case 4: Slow API Response
Monitor:
- ASP.NET Request Time
- Requests/sec
- % Time in GC
- SQL Batch Requests/sec
10. Advantages of PerfMon
✔ Free – built into Windows
✔ Extremely lightweight
✔ Logs run for days
✔ Can monitor local + remote servers
✔ Thousands of counters
✔ Full historical reporting
✔ Used in enterprise load testing
✔ Works with Power BI, Excel, Grafana, Splunk
11. Limitations of PerfMon
❌ Not beginner-friendly
❌ No anomaly detection
❌ Only Windows
❌ Requires manual setup
❌ BLG analysis requires external tools
12. Best Practices
✔ Always create a DCS for load tests
✔ Use 1-sec sampling for short tests
✔ Use 5-sec sampling for long tests
✔ Always include CPU, Memory, Disk, Network
✔ For .NET apps → add CLR counters
✔ For SQL tests → add SQL counters
✔ Log to BLG (not CSV)
✔ Use naming like “Test1_CPU_Memory_Disk”
13. PerfMon vs Other Tools
| Tool | Purpose |
|---|---|
| PerfMon | Deep OS + .NET diagnostics |
| Resource Monitor | Real-time troubleshooting |
| Task Manager | Basic monitoring |
| Process Explorer | Process-level details |
| dotnet-counters | .NET runtime live metrics |
| dotnet-trace | Trace collection |
| SQL Profiler | SQL tracing |
14. Conclusion
PerfMon is one of the most essential performance tools for:
- Developers
- SRE
- DevOps
- Performance Test Engineers
- System Admins
It gives complete visibility into:
- System health
- .NET runtime
- SQL Server
- Disk I/O
- Network
- Application behavior
No Windows performance investigation is complete without PerfMon.
Just tell me.
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at WIZBRAND