{"id":54165,"date":"2025-11-25T07:16:46","date_gmt":"2025-11-25T07:16:46","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=54165"},"modified":"2025-11-25T07:16:46","modified_gmt":"2025-11-25T07:16:46","slug":"perfmon-performance-monitor-the-complete-one-stop-tutorial","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/perfmon-performance-monitor-the-complete-one-stop-tutorial\/","title":{"rendered":"PERFMON (Performance Monitor): The Complete One-Stop Tutorial"},"content":{"rendered":"\n<p>It covers <strong>EVERYTHING<\/strong> you need:<\/p>\n\n\n\n<p>\u2714 What PerfMon is<br>\u2714 Why PerfMon is used<br>\u2714 When to use PerfMon<br>\u2714 PerfMon Architecture<br>\u2714 Key Terminologies<br>\u2714 How PerfMon works<br>\u2714 How to use PerfMon step-by-step<br>\u2714 All important counters<br>\u2714 Real performance engineering use cases<br>\u2714 Advantages, Limitations, Best Practices<br>\u2714 Troubleshooting with PerfMon<br>\u2714 PerfMon vs other tools<\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udcd8 <strong>PERFMON (Performance Monitor): The Complete One-Stop Tutorial<\/strong><\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">1. <strong>Introduction to PerfMon<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What is PerfMon?<\/strong><\/h3>\n\n\n\n<p>PerfMon (Performance Monitor) is a <strong>built-in Windows performance monitoring tool<\/strong> used to collect, visualize, and analyze system and application performance metrics called <strong>performance counters<\/strong>.<\/p>\n\n\n\n<p>It allows you to monitor:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CPU usage<\/li>\n\n\n\n<li>Memory usage<\/li>\n\n\n\n<li>Disk I\/O<\/li>\n\n\n\n<li>Network traffic<\/li>\n\n\n\n<li>Process-level metrics<\/li>\n\n\n\n<li>Thread, handle, and heap usage<\/li>\n\n\n\n<li>.NET CLR health (GC, exceptions, JIT, threads)<\/li>\n\n\n\n<li>IIS \/ ASP.NET metrics<\/li>\n\n\n\n<li>SQL Server counters<\/li>\n\n\n\n<li>Custom application counters<\/li>\n<\/ul>\n\n\n\n<p>PerfMon is one of the <strong>most powerful<\/strong> and <strong>most underutilized<\/strong> diagnostic tools in Windows.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">2. <strong>Why PerfMon Exists (Purpose)<\/strong><\/h1>\n\n\n\n<p>PerfMon helps you:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Detect performance bottlenecks<\/h3>\n\n\n\n<p>CPU spikes, memory leaks, disk contention, network congestion<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Troubleshoot production issues<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>High CPU<\/li>\n\n\n\n<li>Low memory<\/li>\n\n\n\n<li>Disk thrashing<\/li>\n\n\n\n<li>Network bottleneck<\/li>\n\n\n\n<li>Slow API response time<\/li>\n\n\n\n<li>GC pauses<\/li>\n\n\n\n<li>SQL performance issues<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Perform load testing diagnostics<\/h3>\n\n\n\n<p>It allows you to <strong>correlate load tests with system metrics<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Monitor .NET applications<\/h3>\n\n\n\n<p>GC behavior, exceptions\/sec, thread pool usage<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Monitor IIS \/ Kestrel<\/h3>\n\n\n\n<p>Requests\/sec, connection queue, request pipeline health<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Monitor SQL Server<\/h3>\n\n\n\n<p>Batch requests\/sec, compilations, cache hits<\/p>\n\n\n\n<p>PerfMon is essential for <strong>Performance Engineering<\/strong>, <strong>SRE<\/strong>, <strong>DevOps<\/strong>, and <strong>Developers<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">3. <strong>When to Use PerfMon (Scenarios)<\/strong><\/h1>\n\n\n\n<p>Use PerfMon when:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 <strong>You run a load test<\/strong><\/h3>\n\n\n\n<p>You must capture perf counters to see:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CPU<\/li>\n\n\n\n<li>Memory<\/li>\n\n\n\n<li>Disk<\/li>\n\n\n\n<li>Network<\/li>\n\n\n\n<li>.NET GC<\/li>\n\n\n\n<li>SQL Server<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 <strong>Production troubleshooting<\/strong><\/h3>\n\n\n\n<p>When a server is slow, PerfMon reveals patterns.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3\ufe0f\u20e3 <strong>Memory leaks<\/strong><\/h3>\n\n\n\n<p>Watch Private Bytes + GC counters.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4\ufe0f\u20e3 <strong>CPU spikes<\/strong><\/h3>\n\n\n\n<p>Check Processor Time + Context Switches + thread count.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5\ufe0f\u20e3 <strong>Slow disk or file reads<\/strong><\/h3>\n\n\n\n<p>Disk Queue Length is key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6\ufe0f\u20e3 <strong>Slow API throughput<\/strong><\/h3>\n\n\n\n<p>Monitor Requests\/sec + ASP.NET pipeline limits.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7\ufe0f\u20e3 <strong>High GC pauses<\/strong><\/h3>\n\n\n\n<p>% Time in GC tells the story.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">8\ufe0f\u20e3 <strong>SQL Server performance issues<\/strong><\/h3>\n\n\n\n<p>Batch Requests\/sec + Compilations\/sec.<\/p>\n\n\n\n<p>PerfMon is used by <strong>senior engineers<\/strong>, <strong>SREs<\/strong>, <strong>DevOps<\/strong>, <strong>DBAs<\/strong>, and <strong>Performance Test Engineers<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">4. <strong>PerfMon Architecture<\/strong><\/h1>\n\n\n\n<p>PerfMon works on a simple architecture:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\"> Windows Kernel + Applications\n         |\n   Performance Counters (APIs)\n         |\n     PerfMon.exe\n         |\n   - Live Graphs\n   - Reports\n   - Data Collector Sets\n<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Key points:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Windows exposes more than <strong>5,000 counters<\/strong>.<\/li>\n\n\n\n<li>PerfMon reads these counters and shows them.<\/li>\n\n\n\n<li>Counters can come from OS, .NET CLR, SQL Server, IIS, third-party apps.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">5. <strong>Key Terminology<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u27a4 <strong>Performance Counter<\/strong><\/h3>\n\n\n\n<p>A real-time metric exposed by Windows or applications.<\/p>\n\n\n\n<p>Examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>% Processor Time<\/li>\n\n\n\n<li>Available Memory<\/li>\n\n\n\n<li>Disk Queue Length<\/li>\n\n\n\n<li>Bytes Received\/sec<\/li>\n\n\n\n<li>.NET CLR Memory: % Time in GC<\/li>\n\n\n\n<li>SQL Compilations\/sec<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u27a4 <strong>Object<\/strong><\/h3>\n\n\n\n<p>A category of counters, e.g.,<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Processor<\/li>\n\n\n\n<li>Memory<\/li>\n\n\n\n<li>PhysicalDisk<\/li>\n\n\n\n<li>Network Interface<\/li>\n\n\n\n<li>Process<\/li>\n\n\n\n<li>.NET CLR Memory<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u27a4 <strong>Instance<\/strong><\/h3>\n\n\n\n<p>A specific process or core.<\/p>\n\n\n\n<p>Examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Processor \u2192 _Total, 0, 1, 2<\/li>\n\n\n\n<li>Process \u2192 dotnet, chrome, myapp.exe<\/li>\n\n\n\n<li>SQL Server \u2192 MSSQLSERVER<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u27a4 <strong>Data Collector Set (DCS)<\/strong><\/h3>\n\n\n\n<p>A group of counters scheduled to log into a file.<\/p>\n\n\n\n<p>Used for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Load tests<\/li>\n\n\n\n<li>Production monitoring<\/li>\n\n\n\n<li>Historical analysis<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u27a4 <strong>BLG \/ CSV Logs<\/strong><\/h3>\n\n\n\n<p>PerfMon logs stored for later analysis.<\/p>\n\n\n\n<p>BLG is the binary format (smaller, efficient).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">6. <strong>PerfMon Components<\/strong><\/h1>\n\n\n\n<p>PerfMon has three major sections:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>6.1 Performance Monitor (Live Graph)<\/strong><\/h2>\n\n\n\n<p>Shows real-time counters as a line graph.<\/p>\n\n\n\n<p>Great for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Spikes<\/li>\n\n\n\n<li>Bottleneck identification<\/li>\n\n\n\n<li>Correlation during load tests<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>6.2 Data Collector Sets<\/strong><\/h2>\n\n\n\n<p>You can create a DCS that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Runs for hours\/days<\/li>\n\n\n\n<li>Captures hundreds of counters<\/li>\n\n\n\n<li>Saves in BLG or CSV<\/li>\n<\/ul>\n\n\n\n<p>Used in:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Load testing<\/li>\n\n\n\n<li>Production issues<\/li>\n\n\n\n<li>Long-running performance tests<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>6.3 Reports<\/strong><\/h2>\n\n\n\n<p>After a DCS completes, PerfMon auto-generates reports summarizing:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Peak CPU<\/li>\n\n\n\n<li>Memory trend<\/li>\n\n\n\n<li>Disk latency<\/li>\n\n\n\n<li>Network usage<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">7. <strong>How to Use PerfMon (Step-by-Step Tutorial)<\/strong><\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 1: Launch PerfMon<\/strong><\/h2>\n\n\n\n<p>Press:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">Win + R \u2192 perfmon\n<\/code><\/span><\/pre>\n\n\n<p>OR<br>Search: <strong>Performance Monitor<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2: Open \u201cPerformance Monitor\u201d<\/strong><\/h2>\n\n\n\n<p>Left panel \u2192 <strong>Monitoring Tools \u2192 Performance Monitor<\/strong><\/p>\n\n\n\n<p>You will see:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A default red CPU line<\/li>\n\n\n\n<li>Live graph<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3: Add Counters<\/strong><\/h2>\n\n\n\n<p>Click:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">Green + icon \u2192 Add Counters\n<\/code><\/span><\/pre>\n\n\n<p>You will see categories like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Processor<\/li>\n\n\n\n<li>Memory<\/li>\n\n\n\n<li>Disk<\/li>\n\n\n\n<li>Network<\/li>\n\n\n\n<li>Process<\/li>\n\n\n\n<li>.NET CLR Memory<\/li>\n\n\n\n<li>SQLServer:*<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 4: Select Important Counters<\/strong><\/h2>\n\n\n\n<p>Choose your object \u2192 select instance \u2192 click <strong>Add<\/strong>.<\/p>\n\n\n\n<p>Examples:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>For CPU<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">Processor \u2192 % Processor Time \u2192 _Total\nProcess \u2192 % Processor Time \u2192 dotnet\n<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>For Memory<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">Memory<\/span> \u2192 <span class=\"hljs-selector-tag\">Available<\/span> <span class=\"hljs-selector-tag\">MBytes<\/span>\n<span class=\"hljs-selector-tag\">Memory<\/span> \u2192 % <span class=\"hljs-selector-tag\">Committed<\/span> <span class=\"hljs-selector-tag\">Bytes<\/span>\n<span class=\"hljs-selector-tag\">Process<\/span> \u2192 <span class=\"hljs-selector-tag\">Private<\/span> <span class=\"hljs-selector-tag\">Bytes<\/span> \u2192 <span class=\"hljs-selector-tag\">myapp<\/span><span class=\"hljs-selector-class\">.exe<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>For Disk<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">PhysicalDisk \u2192 Avg. Disk Queue Length \u2192 _Total\n<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>For Network<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">Network <span class=\"hljs-class\"><span class=\"hljs-keyword\">Interface<\/span> \u2192 <span class=\"hljs-title\">Bytes<\/span> <span class=\"hljs-title\">Total<\/span>\/<span class=\"hljs-title\">sec<\/span>\n<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><strong>For .NET<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">.NET CLR Memory \u2192 % Time in GC \u2192 myapp.exe\n.NET CLR Exceptions \u2192 <span class=\"hljs-comment\"># Exceptions\/sec \u2192 myapp.exe<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 5: Analyze Graphs<\/strong><\/h2>\n\n\n\n<p>Watch the graphs for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Spikes<\/li>\n\n\n\n<li>Trends<\/li>\n\n\n\n<li>Degradation<\/li>\n\n\n\n<li>Correlation with load<\/li>\n<\/ul>\n\n\n\n<p>PerfMon lets you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Change line colors<\/li>\n\n\n\n<li>Change scale<\/li>\n\n\n\n<li>Pause<\/li>\n\n\n\n<li>Zoom in<\/li>\n\n\n\n<li>Pin counters<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 6: Create Data Collector Set (DCS)<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why?<\/strong><\/h3>\n\n\n\n<p>For long-term monitoring (load test, 1 hour+).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Steps:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Right-click \u2192 <strong>Data Collector Sets \u2192 User Defined<\/strong><\/li>\n\n\n\n<li><strong>New \u2192 Data Collector Set<\/strong><\/li>\n\n\n\n<li>Add performance counters<\/li>\n\n\n\n<li>Set sample interval (1 sec or 5 sec)<\/li>\n\n\n\n<li>Choose log path<\/li>\n\n\n\n<li>Click Finish<\/li>\n\n\n\n<li>Start the DCS<\/li>\n<\/ol>\n\n\n\n<p>You now have automatic background logging.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 7: View Reports<\/strong><\/h2>\n\n\n\n<p>After DCS completes:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">Reports \u2192 User Defined \u2192 Your DCS\n<\/code><\/span><\/pre>\n\n\n<p>You will see:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CPU peaks<\/li>\n\n\n\n<li>Memory trend<\/li>\n\n\n\n<li>Disk I\/O charts<\/li>\n\n\n\n<li>Network summary<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">8. <strong>Most Important PerfMon Counters<\/strong><\/h1>\n\n\n\n<p>Here are the <strong>mission-critical<\/strong> counters for troubleshooting.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>CPU<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Counter<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td>Processor \u2192 % Processor Time<\/td><td>CPU bottleneck (&gt;80%)<\/td><\/tr><tr><td>Process \u2192 % Processor Time<\/td><td>Per-process CPU<\/td><\/tr><tr><td>System \u2192 Context Switches\/sec<\/td><td>Thread contention<\/td><\/tr><tr><td>Processor \u2192 % Privileged Time<\/td><td>Kernel overhead<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Memory<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Counter<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td>Memory \u2192 Available MBytes<\/td><td>Memory pressure<\/td><\/tr><tr><td>% Committed Bytes In Use<\/td><td>If &gt;80% \u2192 close to paging<\/td><\/tr><tr><td>Process \u2192 Private Bytes<\/td><td>Memory leak indicator<\/td><\/tr><tr><td>Paging File \u2192 % Usage<\/td><td>Disk paging<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Disk<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Counter<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td>Avg. Disk Queue Length<\/td><td>Disk bottleneck if &gt;2 per spindle<\/td><\/tr><tr><td>Avg. sec\/Read<\/td><td>Disk read latency<\/td><\/tr><tr><td>Avg. sec\/Write<\/td><td>Disk write latency<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Network<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Counter<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td>Bytes Total\/sec<\/td><td>Throughput<\/td><\/tr><tr><td>Output Queue Length<\/td><td>NIC congestion<\/td><\/tr><tr><td>TCP Retransmissions\/sec<\/td><td>Network issues<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>.NET CLR<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Counter<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td>% Time in GC<\/td><td>GC pauses<\/td><\/tr><tr><td># Gen 2 Collections<\/td><td>Full GCs are expensive<\/td><\/tr><tr><td># Exceptions\/sec<\/td><td>Exception storms<\/td><\/tr><tr><td>LOH Size<\/td><td>LOH fragmentation<\/td><\/tr><tr><td>Thread Count<\/td><td>Thread pool starvation<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>ASP.NET \/ IIS<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Counter<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td>Requests\/sec<\/td><td>Throughput<\/td><\/tr><tr><td>Request Execution Time<\/td><td>API delay<\/td><\/tr><tr><td>Current Connections<\/td><td>Server load<\/td><\/tr><tr><td>Pipeline Instance Count<\/td><td>Bottlenecks<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>SQL Server<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Counter<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td>Batch Requests\/sec<\/td><td>Query throughput<\/td><\/tr><tr><td>Compilations\/sec<\/td><td>Poor plan caching<\/td><\/tr><tr><td>Buffer Cache Hit Ratio<\/td><td>Memory pressure<\/td><\/tr><tr><td>Page Life Expectancy<\/td><td>SQL memory issues<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">9. <strong>PerfMon Use Cases<\/strong><\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2714 Use Case 1: High CPU<\/strong><\/h2>\n\n\n\n<p>Counters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Processor \u2192 % Processor Time<\/li>\n\n\n\n<li>Process \u2192 % Processor Time<\/li>\n\n\n\n<li>Context Switches\/sec<\/li>\n\n\n\n<li>Thread Count<\/li>\n<\/ul>\n\n\n\n<p>You identify:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hot processes<\/li>\n\n\n\n<li>Bad loops<\/li>\n\n\n\n<li>Thread contention<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2714 Use Case 2: Memory Leak<\/strong><\/h2>\n\n\n\n<p>Monitor:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Private Bytes<\/li>\n\n\n\n<li>Working Set<\/li>\n\n\n\n<li>% Committed Bytes<\/li>\n\n\n\n<li>GC counters<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2714 Use Case 3: Disk Bottleneck<\/strong><\/h2>\n\n\n\n<p>Monitor:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Disk Queue Length<\/li>\n\n\n\n<li>Disk latency (Avg sec\/Read)<\/li>\n\n\n\n<li>Page File usage<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2714 Use Case 4: Slow API Response<\/strong><\/h2>\n\n\n\n<p>Monitor:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ASP.NET Request Time<\/li>\n\n\n\n<li>Requests\/sec<\/li>\n\n\n\n<li>% Time in GC<\/li>\n\n\n\n<li>SQL Batch Requests\/sec<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">10. <strong>Advantages of PerfMon<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Free \u2013 built into Windows<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Extremely lightweight<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Logs run for days<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Can monitor local + remote servers<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Thousands of counters<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Full historical reporting<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Used in enterprise load testing<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u2714 Works with Power BI, Excel, Grafana, Splunk<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">11. <strong>Limitations of PerfMon<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c Not beginner-friendly<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c No anomaly detection<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c Only Windows<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c Requires manual setup<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c BLG analysis requires external tools<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">12. <strong>Best Practices<\/strong><\/h1>\n\n\n\n<p>\u2714 Always create a DCS for load tests<br>\u2714 Use 1-sec sampling for short tests<br>\u2714 Use 5-sec sampling for long tests<br>\u2714 Always include CPU, Memory, Disk, Network<br>\u2714 For .NET apps \u2192 add CLR counters<br>\u2714 For SQL tests \u2192 add SQL counters<br>\u2714 Log to BLG (not CSV)<br>\u2714 Use naming like &#8220;Test1_CPU_Memory_Disk&#8221;<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">13. <strong>PerfMon vs Other Tools<\/strong><\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Tool<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td><strong>PerfMon<\/strong><\/td><td>Deep OS + .NET diagnostics<\/td><\/tr><tr><td><strong>Resource Monitor<\/strong><\/td><td>Real-time troubleshooting<\/td><\/tr><tr><td><strong>Task Manager<\/strong><\/td><td>Basic monitoring<\/td><\/tr><tr><td><strong>Process Explorer<\/strong><\/td><td>Process-level details<\/td><\/tr><tr><td><strong>dotnet-counters<\/strong><\/td><td>.NET runtime live metrics<\/td><\/tr><tr><td><strong>dotnet-trace<\/strong><\/td><td>Trace collection<\/td><\/tr><tr><td><strong>SQL Profiler<\/strong><\/td><td>SQL tracing<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">14. <strong>Conclusion<\/strong><\/h1>\n\n\n\n<p>PerfMon is one of the <strong>most essential performance tools<\/strong> for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Developers<\/li>\n\n\n\n<li>SRE<\/li>\n\n\n\n<li>DevOps<\/li>\n\n\n\n<li>Performance Test Engineers<\/li>\n\n\n\n<li>System Admins<\/li>\n<\/ul>\n\n\n\n<p>It gives <strong>complete visibility<\/strong> into:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>System health<\/li>\n\n\n\n<li>.NET runtime<\/li>\n\n\n\n<li>SQL Server<\/li>\n\n\n\n<li>Disk I\/O<\/li>\n\n\n\n<li>Network<\/li>\n\n\n\n<li>Application behavior<\/li>\n<\/ul>\n\n\n\n<p>No Windows performance investigation is complete without PerfMon.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<p>Just tell me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It covers EVERYTHING you need: \u2714 What PerfMon is\u2714 Why PerfMon is used\u2714 When to use PerfMon\u2714 PerfMon Architecture\u2714 Key Terminologies\u2714 How PerfMon works\u2714 How to use PerfMon step-by-step\u2714 All&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[11138],"tags":[],"class_list":["post-54165","post","type-post","status-publish","format-standard","hentry","category-best-tools"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/54165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=54165"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/54165\/revisions"}],"predecessor-version":[{"id":54166,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/54165\/revisions\/54166"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=54165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=54165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=54165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}