MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

PERFMON (Performance Monitor): Demo & Lab

PerfMon Add Counters dialog showing .NET CLR counter categories and the Add button highlighted

Below is the definitive, step-by-step list of PerfMon counters you must add for .NET / ASP.NET Core / API / Microservices performance optimization.

This is the same checklist used in enterprise performance engineering, load testing, and production diagnostics.

I will give you:

โœ” Exact counters
โœ” In step-by-step order
โœ” Why each counter matters
โœ” Which ones are optional vs mandatory
โœ” What values are considered โ€œbadโ€

This is your final PerfMon Counter Checklist for .NET performance.


STEP-BY-STEP: Add These PerfMon Counters for .NET Application Performance Optimization


๐Ÿ”ต STEP 1 โ€” Add Essential CPU Counters (Mandatory)

โœ” Processor

  • % Processor Time โ€” _Total
  • % Privileged Time โ€” _Total
  • % Interrupt Time
  • Processor Queue Length (from System)

โœ” Process (for your app)

Select instance:
โžก dotnet, w3wp, or yourapp.exe

Add:

  • % Processor Time
  • Thread Count
  • Handle Count
  • Private Bytes
  • Working Set
  • IO Data Bytes/sec
  • IO Read Bytes/sec
  • IO Write Bytes/sec

Why CPU counters matter

  • Detect CPU saturation (>80%)
  • Find thread pool starvation
  • Detect infinite loops, heavy JSON serialization, LINQ misuse
  • Detect high kernel (privileged) usage โ†’ drivers, encryption, networking

๐ŸŸฃ STEP 2 โ€” Add Memory Counters (Mandatory)

โœ” Memory

  • Available MBytes
  • % Committed Bytes in Use
  • Pages/sec
  • Page Reads/sec
  • Cache Faults/sec
  • Committed Bytes

โœ” Process (your app)

  • Private Bytes (memory leak indicator)
  • Virtual Bytes
  • Working Set
  • Page Faults/sec

Why Memory counters matter

  • Identify memory leaks
  • Detect high paging โ†’ application slowdown
  • Understand GC pressure
  • Identify large object allocations

๐ŸŸข STEP 3 โ€” Add Disk I/O Counters (Mandatory)

โœ” PhysicalDisk

(_Total)

  • Avg. Disk Queue Length
  • Avg. Disk sec/Read
  • Avg. Disk sec/Write
  • Disk Reads/sec
  • Disk Writes/sec
  • Current Disk Queue Length

โœ” LogicalDisk

  • % Free Space
  • Free Megabytes

Why disk counters matter

  • Identify disk bottlenecks
  • Troubleshoot long API latency caused by slow file or database I/O.
  • Detect heavy logging or temp file writes

๐ŸŸก STEP 4 โ€” Add Network Counters (Mandatory for API/Web App)

โœ” Network Interface

  • Bytes Total/sec
  • Bytes Received/sec
  • Bytes Sent/sec
  • Output Queue Length
  • Packets/sec
  • Packets Outbound Errors
  • Packets Received Errors

โœ” TCPv4

  • Connections Established
  • Connection Failures
  • Segments Retransmitted/sec

Why network counters matter

  • Understand throughput
  • Detect API congestion
  • Detect retransmissions (network instability)

๐Ÿ”ด STEP 5 โ€” Add .NET CLR Counters (CRITICAL for .NET Performance)

โžก In PerfMon UI, expand:
โ€œ.NET CLR Memoryโ€
โ€œ.NET CLR Exceptionsโ€
โ€œ.NET CLR Jitโ€
โ€œ.NET CLR LocksAndThreadsโ€
โ€œ.NET CLR Networkingโ€

Select your instance:
dotnet, w3wp, or your application name.


๐Ÿ€ .NET CLR MEMORY (Very Important)

โœ” Add these:

  • % Time in GC
  • Gen 0 Collections
  • Gen 1 Collections
  • Gen 2 Collections ๐Ÿ”ฅ
  • Large Object Heap Size ๐Ÿ”ฅ
  • # Bytes in all Heaps
  • Promoted Memory/sec
  • Finalization Survivors
  • GC Handles

Interpretation:

CounterMeaning
% Time in GC > 15%Too much GC blocking = slow app
Frequent Gen 2 GCMemory pressure / large objects
High LOH sizeLarge object allocations causing fragmentation
High Promoted MB/secShort-lived objects living too long

๐Ÿ€ .NET CLR EXCEPTIONS

Add:

  • # of Exceptions Thrown/sec

This indicates:

  • Poor coding practices
  • Bad error handling
  • Hidden exceptions killing performance

If > 100/sec consistently โ†’ WRONG code.


๐Ÿ€ .NET CLR LOCKS & THREADS

Add:

  • # of current logical Threads
  • # of current physical Threads
  • Contention Rate/sec
  • Queue Length

Indicates:

  • Thread pool starvation
  • Async deadlocks
  • High locking contention

๐Ÿ€ .NET CLR JIT

Add:

  • % Time in JIT
  • IL Bytes Jitted/sec

JIT issues appear on:

  • Cold starts
  • Large reflection / dynamic LINQ usage

๐ŸŸค STEP 6 โ€” Add ASP.NET / IIS Counters (If Web App or API)

โœ” ASP.NET Applications

(Select your app pool)

Add:

  • Requests/Sec
  • Requests Queued
  • Requests Rejected
  • Request Execution Time
  • Pipeline Instance Count

โœ” ASP.NET

  • Application Restarts
  • Worker Process Restarts

โœ” Web Service

(For old .NET Framework)

  • Total Method Requests/sec

โœ” WinHTTP Proxy/Service

If using HttpClient extensively.


๐Ÿ”ต STEP 7 โ€” Add Kestrel & Hosting Counters (.NET Core Self-hosted)

If running on Kestrel (non-IIS):

โœ” ASP.NET Core Hosting

  • Current Requests
  • Requests/sec
  • Request Queue Length

โœ” Kestrel

(Available in dotnet counters, but PerfMon may expose via EventSource)

  • Connection queue length
  • Active connections
  • TLS handshake duration

๐ŸŸฃ STEP 8 โ€” Add SQL Server Counters (If Your App Uses DB)

Category: SQLServer:SQL Statistics

  • Batch Requests/sec
  • Compilations/sec
  • Re-Compilations/sec

Category: SQLServer:Buffer Manager

  • Buffer cache hit ratio
  • Page life expectancy (PLE)

Category: SQLServer:General Statistics

  • User Connections
  • Processes blocked

Category: SQLServer:Wait Statistics

  • Lock waits/sec
  • Latch waits/sec

These help detect:

  • Query bottlenecks
  • High CPU SQL queries
  • Plan cache issues
  • Memory pressure

๐ŸŽฏ FINAL: Complete List (Copy-Paste Checklist)

Here is the single list you can paste into training material:


โœ” CPU

  • Processor โ†’ % Processor Time (_Total)
  • Processor โ†’ % Privileged Time
  • Processor โ†’ % Interrupt Time
  • System โ†’ Processor Queue Length
  • Process(dotnet/w3wp/app.exe) โ†’ % Processor Time
  • Thread Count
  • Handle Count

โœ” Memory

  • Memory โ†’ Available MBytes
  • Memory โ†’ % Committed Bytes
  • Memory โ†’ Pages/sec
  • Process โ†’ Private Bytes
  • Process โ†’ Page Faults/sec
  • Process โ†’ Working Set

โœ” Disk

  • Avg. Disk Queue Length
  • Avg. Disk sec/Read
  • Avg. Disk sec/Write
  • Disk Reads/sec
  • Disk Writes/sec

โœ” Network

  • Bytes Total/sec
  • TCP Retransmissions/sec
  • Connections Established
  • Packets Errors

โœ” .NET CLR Memory

  • % Time in GC
  • Gen 0/1/2 Collections
  • Promoted MB/sec
  • Bytes in All Heaps
  • LOH Size

โœ” .NET CLR Exceptions

  • Exceptions/sec

โœ” .NET CLR LocksAndThreads

  • Contention Rate/sec
  • Logical Threads
  • Physical Threads

โœ” ASP.NET / Hosting

  • Requests/sec
  • Current Requests
  • Request Queue Length
  • Request Execution Time

โœ” SQL Server

  • Batch Requests/sec
  • SQL Compilations/sec
  • SQL Re-compilations/sec
  • Buffer Cache Hit Ratio
  • Page Life Expectancy

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Host Your Own NuGet Feed: Local Source vs NuGet.Server vs NuGetGallery

Learn how to host a private NuGet feed using three practical approaches: a local folder source, NuGet.Server, and NuGetGallery. This revised guide includes setup steps, command examples, and a workflow diagram to help you choose the right model.

Read More

DOTNET: Capstone Project for DOTNET Performance Optimization

1. Recommended GitHub Application Chosen app: NimblePros/eShopOnWeb Repo: https://github.com/NimblePros/eShopOnWeb (GitHub) Why this one: Weโ€™ll treat: 2. Capstone: High-Level Structure Your โ€œDOTNET Performance Optimization Capstoneโ€ will use eShopOnWeb…

Read More

Database Performance Optimization in .NET + MSSQL

A Complete End-to-End Guide for High-Performance Data Access in ASP.NET Applications โญ PREFACE Modern ASP.NET applications rely heavily on databasesโ€”not just to store records, but to power…

Read More

DOTNET: Kestrel-only / ASP.NET Core hosting-side performance techniques

Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have…

Read More

DOTNET: IIS Performance Checklist

โœ… IIS-Only Performance Optimization Settings (Complete List) 1. Application Pool Settings (IIS Core) โœ” Start Mode โœ” Idle Time-out โœ” Worker Process Settings โœ” Recycling Settings 2….

Read More

DOTNET: How to improve an application performance of DOTNET? A Complete Checklist

0. First principle: measure before tuning Before touching settings: 1. OS & Hardware-level optimizations These are outside IIS but critical: 2. IIS application pool tuning 2.1 .NET…

Read More
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Skylar Bennett
Skylar Bennett
1 year ago

Really impressive and practical lab โ€” a very detailed โ€œchecklistโ€‘styleโ€ guide for anyone looking to use PerfMon for .NET / ASP.NET Core / API / Microservices performance tuning! The stepโ€‘byโ€‘step list of recommended counters (CPU, Memory, Disk I/O, Network, .NET CLR metrics, etc.), along with clear explanations of why each counter matters, makes this tutorial especially useful for diagnosing realโ€‘world performance bottlenecks โ€” from CPU saturation and memory leaks to disk latency and GC pressure. For engineering teams or SRE/DevOps folks, having this as a readyโ€‘toโ€‘use โ€œcounterโ€‘set checklistโ€ is a huge timeโ€‘saver and a solid foundation for consistent monitoring across applications. ๐Ÿ‘

Jason Mitchell
Jason Mitchell
1 year ago

This labโ€‘style tutorial provides a practical, stepโ€‘byโ€‘step walkthrough of using Windowsโ€™ builtโ€‘in Performance Monitor (PerfMon) tool. It goes beyond the basics by showing how to select meaningful performance counters (CPU usage, process working set, GC cycles, SQL Server batch requests) and compare realโ€‘world scenariosโ€”such as nonโ€‘optimized versus optimized code paths. For DevOps engineers or SREs teaching interns, this piece is especially valuable because it bridges the gap between โ€œwhat can I monitorโ€ and โ€œhow do I interpret the data to find a bottleneck or design flawโ€. With the kind of handsโ€‘on examples provided, itโ€™s an excellent resource for boosting your ability to gather actionable metrics and then use them for performance tuning or capacityโ€‘planning exercises.

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