Turn Your Vehicle Into a Smart Earning Asset

While you’re not driving your car or bike, it can still be working for you. MOTOSHARE helps you earn passive income by connecting your vehicle with trusted renters in your city.

🚗 You set the rental price
🔐 Secure bookings with verified renters
📍 Track your vehicle with GPS integration
💰 Start earning within 48 hours

Join as a Partner Today

It’s simple, safe, and rewarding. Your vehicle. Your rules. Your earnings.

PERFMON (Performance Monitor): The Complete One-Stop Tutorial

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

MemoryAvailable MBytes
Memory → % Committed Bytes
ProcessPrivate Bytesmyapp.exe
Code language: CSS (css)

For Disk

PhysicalDisk → Avg. Disk Queue Length → _Total

For Network

Network InterfaceBytes 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:

  1. Right-click → Data Collector Sets → User Defined
  2. New → Data Collector Set
  3. Add performance counters
  4. Set sample interval (1 sec or 5 sec)
  5. Choose log path
  6. Click Finish
  7. 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

CounterWhy
Processor → % Processor TimeCPU bottleneck (>80%)
Process → % Processor TimePer-process CPU
System → Context Switches/secThread contention
Processor → % Privileged TimeKernel overhead

Memory

CounterWhy
Memory → Available MBytesMemory pressure
% Committed Bytes In UseIf >80% → close to paging
Process → Private BytesMemory leak indicator
Paging File → % UsageDisk paging

Disk

CounterWhy
Avg. Disk Queue LengthDisk bottleneck if >2 per spindle
Avg. sec/ReadDisk read latency
Avg. sec/WriteDisk write latency

Network

CounterWhy
Bytes Total/secThroughput
Output Queue LengthNIC congestion
TCP Retransmissions/secNetwork issues

.NET CLR

CounterWhy
% Time in GCGC pauses
# Gen 2 CollectionsFull GCs are expensive
# Exceptions/secException storms
LOH SizeLOH fragmentation
Thread CountThread pool starvation

ASP.NET / IIS

CounterWhy
Requests/secThroughput
Request Execution TimeAPI delay
Current ConnectionsServer load
Pipeline Instance CountBottlenecks

SQL Server

CounterWhy
Batch Requests/secQuery throughput
Compilations/secPoor plan caching
Buffer Cache Hit RatioMemory pressure
Page Life ExpectancySQL 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

ToolPurpose
PerfMonDeep OS + .NET diagnostics
Resource MonitorReal-time troubleshooting
Task ManagerBasic monitoring
Process ExplorerProcess-level details
dotnet-counters.NET runtime live metrics
dotnet-traceTrace collection
SQL ProfilerSQL 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.

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x