Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
01-31-2020 02:06 PM
I'm using AppD 4.5.11.3848 and Oracle JDK 1.8.0_231.
I've seen some incorrect process CPU% reported by the java agent. It appears that the number is being derived as follows:
Process CPU burnt (ms/min)/60000/Runtime.availableProcessors()
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(). So, if there are 4 CPUs and the "cpu burnt" number is 30000, then we'd have 30000/60000/4, which is 12.5%
However, the Runtime.availableProcessors() method doesn't always report the actual number of processors. Instead, if -XX:ActiveProcessorCount=n is set, it uses that. 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.)
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.
thanks
03-03-2020 07:14 AM
John,
You are correct that this is the method used to calculate this metric.
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.
It is possible to track the process CPU consumption vs the resources of the entire machine using the SIM agent
Does this latter method address your needs?
Warm regards,
Peter
03-03-2020 08:59 AM
The active processor count doesn't itself limit the number of CPUs the JVM can use in a general way. Would you expect this option to only be used in combination with other features?
Here is an example of CPU usage during a load test. Active processor count was 4 but there were 8 CPUs on the machine and you can clearly see all 8 CPUs being used equally.
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.
thanks
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form