<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Process CPU % is incorrect? in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/Process-CPU-is-incorrect/m-p/719859#M1730</link>
    <description>&lt;P&gt;I'm using AppD 4.5.11.3848 and Oracle JDK 1.8.0_231.&lt;/P&gt;&lt;P&gt;I've seen some incorrect process CPU% reported by the java agent.&amp;nbsp; It appears that the number is being derived as follows:&lt;/P&gt;&lt;P&gt;Process CPU burnt (ms/min)/60000/Runtime.availableProcessors()&lt;/P&gt;&lt;P&gt;In other words, the number of milliseconds of CPU used in a minute, divided by the number of milliseconds in a minute, divided by the result of Runtime.availableProcessors().&amp;nbsp; So, if there are 4 CPUs and the "cpu burnt" number is 30000, then we'd have 30000/60000/4, which is 12.5%&lt;/P&gt;&lt;P&gt;However, the Runtime.availableProcessors() method doesn't always report the actual number of processors.&amp;nbsp; Instead, if -XX:ActiveProcessorCount=n is set, it uses that.&amp;nbsp; In my example, if there were actually 8 CPUs but -XX:ActiveProcessorCount=4 is set, then AppD will report 12.5% when the actual number should be 6.25% (divide by 8 instead of 4.)&lt;/P&gt;&lt;P&gt;The active processor count does not actually limit the number of CPUs the process can use so I think this method of calculating process CPU % fails when the active processor count is set to something other than the actual value.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2020 22:06:10 GMT</pubDate>
    <dc:creator>JohnGregg</dc:creator>
    <dc:date>2020-01-31T22:06:10Z</dc:date>
    <item>
      <title>Process CPU % is incorrect?</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Process-CPU-is-incorrect/m-p/719859#M1730</link>
      <description>&lt;P&gt;I'm using AppD 4.5.11.3848 and Oracle JDK 1.8.0_231.&lt;/P&gt;&lt;P&gt;I've seen some incorrect process CPU% reported by the java agent.&amp;nbsp; It appears that the number is being derived as follows:&lt;/P&gt;&lt;P&gt;Process CPU burnt (ms/min)/60000/Runtime.availableProcessors()&lt;/P&gt;&lt;P&gt;In other words, the number of milliseconds of CPU used in a minute, divided by the number of milliseconds in a minute, divided by the result of Runtime.availableProcessors().&amp;nbsp; So, if there are 4 CPUs and the "cpu burnt" number is 30000, then we'd have 30000/60000/4, which is 12.5%&lt;/P&gt;&lt;P&gt;However, the Runtime.availableProcessors() method doesn't always report the actual number of processors.&amp;nbsp; Instead, if -XX:ActiveProcessorCount=n is set, it uses that.&amp;nbsp; In my example, if there were actually 8 CPUs but -XX:ActiveProcessorCount=4 is set, then AppD will report 12.5% when the actual number should be 6.25% (divide by 8 instead of 4.)&lt;/P&gt;&lt;P&gt;The active processor count does not actually limit the number of CPUs the process can use so I think this method of calculating process CPU % fails when the active processor count is set to something other than the actual value.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 22:06:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Process-CPU-is-incorrect/m-p/719859#M1730</guid>
      <dc:creator>JohnGregg</dc:creator>
      <dc:date>2020-01-31T22:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Process CPU % is incorrect?</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Process-CPU-is-incorrect/m-p/719860#M1731</link>
      <description>&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;You are correct that this is the method used to calculate this metric.&lt;/P&gt;&lt;P&gt;The net result is that it measures the CPU consumption as a percentage of the resources that the JVM user declared were allocated to the JVM, a measure that is useful to some customers, so just changing the way it is calculated is problematic.&lt;/P&gt;&lt;P&gt;It is possible to track the process CPU consumption vs the resources of the entire machine &lt;A href="https://docs.appdynamics.com/display/PRO44/Server+Process+Metrics" target="_self" rel="nofollow noopener noreferrer"&gt;using the SIM agent&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Does this latter method address your needs?&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 15:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Process-CPU-is-incorrect/m-p/719860#M1731</guid>
      <dc:creator>Peter_Holditch</dc:creator>
      <dc:date>2020-03-03T15:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Process CPU % is incorrect?</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Process-CPU-is-incorrect/m-p/719861#M1732</link>
      <description>&lt;P&gt;The active processor count doesn't itself limit the number of CPUs the JVM can use in a general way.&amp;nbsp; Would you expect this option to only be used in combination with other features?&lt;/P&gt;&lt;P&gt;Here is an example of CPU usage during a load test.&amp;nbsp; Active processor count was 4 but there were 8 CPUs on the machine and you can clearly see all 8 CPUs being used equally.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="8 CPUs used equally" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/36363i288AAE1F5CC9391E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;8 CPUs used equally&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As it is, the calculated process CPU usage is incorrect for cases where the total CPU count is greater than the specified active processor count.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 16:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Process-CPU-is-incorrect/m-p/719861#M1732</guid>
      <dc:creator>JohnGregg</dc:creator>
      <dc:date>2020-03-03T16:59:58Z</dc:date>
    </item>
  </channel>
</rss>

