<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Perfview Command for Capturing Automated High CPU Dumps</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/highcpucapture/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/highcpucapture/feed.xml</link>
    <description>Perfview Command for Capturing Automated High CPU Dumps</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:50:06 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Perfview Command for Capturing Automated High CPU Dumps</title>
      <link>https://docs.microsoft.com/archive/blogs/highcpucapture/perfview-command-for-capturing-automated-high-cpu-dumps</link>
      <pubDate>Sun, 16 Jul 2017 10:48:24 GMT</pubDate>
      <dc:creator><![CDATA[Priyanka Pillai]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/highcpucapture/?p=1</guid>
      <description><![CDATA[CPU utilization plays a vital role in the performance of your application. When it comes to web...]]></description>
      <content:encoded><![CDATA[<p style="margin: 0in;text-align: left;color: #333333;font-family: 'Times New Roman';font-size: 11pt">CPU utilization plays a vital role in the performance of your application. When it comes to web applications which are expected to run round the clock, the impact caused by a CPU spike will be catastrophic as the responsiveness of the application will get worse when there are not enough CPU resources to consume.</p>
<p style="margin: 0in;text-align: left;color: #333333;font-family: 'Times New Roman';font-size: 11pt">There are so many tools which were used to perform the high CPU troubleshooting.</p>
<p style="margin: 0in;text-align: left;color: #333333;font-family: 'Times New Roman';font-size: 11pt">For most of the high CPU problems we would need to capture a memory dump to get to the bottom of the issue,the most conventional way to capture a memory dump would be to <span>manually trigger a dump using one of the many available tools during the exact time of issue. But there are times where it will not be feasible for us to manually trigger a Memory dump at the issue time. For example, the issue might happen during night time where  no one will be  around to capture the data. For such kind of </span>Scenarios Automated way of capturing Data is always good. In this article I will walk you through one of such automated ways.</p>

<h1 style="margin: 0in;font-family: 'Times New Roman';font-size: 11.0pt;color: #333333"></h1>
<h4><b>Steps for capturing High CPU Automated Dumps Using Perfview Command</b></h4>
&nbsp;
<ul>
 	<li>
<h5><b>Scenario 1: If you have only one <span style="color: #000000">w3wp.exe</span> process running on the box.</b></h5>
</li>
</ul>
<p style="padding-left: 60px">Then Use the below command:</p>
<p style="padding-left: 60px"><span style="color: #0000ff">Perfview /NoGui collect "/StopOnPerfCounter=Process:% Processor Time:w3wp&gt;25" -ThreadTime -CircularMB:1000 -CollectMultiple:5 –accepteula </span></p>
<p style="padding-left: 60px">Here <span style="color: #0000ff">25</span> is the threshold value which show the CPU consumption by <span style="color: #0000ff">w3wp</span> in %.And also this value can vary.</p>
<p style="padding-left: 60px">Example<b>:</b> If you're seeing 80% to 90% CPU  utilization by <span style="color: #0000ff">w3wp.exe</span> then this threshold value would be 80.</p>

<ul>
 	<li>
<h5><b> Scenario 2: If we running across multiple w3wp.exe process running on the box.</b></h5>
</li>
</ul>
<p style="padding-left: 60px">Then the command will be:</p>
<p style="padding-left: 60px"><span style="color: #0000ff">Perfview /NoGui collect "/StopOnPerfCounter=Process:% Processor Time:<b>w3wp#</b>&gt;25" -ThreadTime -CircularMB:1000 -CollectMultiple:5 –accepteula </span></p>
<p style="padding-left: 60px">So here we are dealing with <span style="color: #0000ff">w3wp#</span> . What is <span style="color: #0000ff">#</span> here? how to get it, let's see this is below steps.</p>

<h6 style="padding-left: 30px">1. Open the Task Manager look for the wp3wp.exe which is consuming high CPU.</h6>
<p style="padding-left: 30px"><img width="601" height="36" class="alignnone wp-image-76 " alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/clip_image00228.jpg" /></p>
<p style="padding-left: 30px">2. Process ID : 8208 (w3wp)</p>
<p style="padding-left: 30px"><span style="font-family: 'Times New Roman';font-size: 12.0pt;font-weight: normal;font-style: normal;color: black">3. Start the Perfmon.</span></p>
<p style="padding-left: 30px"><span style="font-family: 'Times New Roman';font-size: 12.0pt;color: black">4. Start &gt;&gt; Run &gt;&gt;CMD &gt;&gt;Perfmon then Enter.</span></p>
<p style="padding-left: 30px"><span style="font-family: 'Times New Roman';font-size: 12.0pt;color: black">5. It will open the below window.</span></p>
<p style="padding-left: 30px"><img width="596" height="263" class="alignnone wp-image-97 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/clip_image0031.jpg" /></p>
<p style="padding-left: 30px">6. Choose <span>Process</span> from the print queue. Under that select ID Process.</p>
<p style="padding-left: 30px"><img width="597" height="444" class="alignnone wp-image-57 " alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/313.png" /></p>
<p style="padding-left: 30px">7. Under that select all the instance and search for w3wp in the text box. So you will be getting below window. Now at last click on ADD and then click ok.</p>
<p style="padding-left: 30px"><img width="601" height="446" class="alignnone wp-image-57 " alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/313.png" /></p>
        <img width="603" height="431" class="alignnone wp-image-55 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/53.jpg" />
<p style="padding-left: 30px">8. On the below screen, look for the affected wp3wp with same process id. So in this case the wp3wp would be w3wp#2.</p>
         <img width="596" height="425" class="alignnone wp-image-56 " alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/65-e1500760150437.jpg" />

&nbsp;
<p style="padding-left: 30px">So here the w3wp# value would be <b>w3wp#2. </b>And now our command would be like this.</p>
<p style="padding-left: 30px">Perfview /NoGui collect "/StopOnPerfCounter=Process:% Processor Time:<b>w3wp#2</b>&gt;75" -ThreadTime -CircularMB:1000 -CollectMultiple:5 –accepteula</p>]]></content:encoded>
    </item>
  </channel>
</rss>