Splunk AppDynamics

Process CPU % is incorrect?

JohnGregg
Path Finder

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

Labels (1)
Tags (2)

Peter_Holditch
Builder

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

JohnGregg
Path Finder

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.

image.png8 CPUs 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

Get Updates on the Splunk Community!

Demo Day: Strengthen Your SOC with Splunk Enterprise Security 8.1

Today’s threat landscape is more complex than ever. Security operation centers (SOCs) are overwhelmed with ...

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...