What is the CPU Utilization in New Relic APM Alerts?

###Alerts Question Template

We are planning to define New Alerts for our applications. While defining a New Relic Alerts Policy for Java based applications, we wanted to know what do we mean by the CPU Utilization Time metric for an application (the option under JVM Health Metric type of Condition)? How is it different from the CPU metric coming from ProcessSample and SystemSample?
I have highlighted the alert metric that I want to understand.

Helpful Resources
Relic Solution: The key to consistent alert notifications

Troubleshooting downtime document

Any inputs on this? Its a bit confusing in terms of what exactly the CPU Utilization denotes while defining an APM-JVM Alert?

Here is my understanding:

Let’s say we have Application A which is running inside a Docker container on K8s. For example, to this pod, I have assigned the following resources:
CPU: 70m
Heap: 1264mi

And there are let’s say 5 instances of this application A running. Then what we see in Alert Condition window while defining an APM Alert Condition ( type->JVM Health Metric, metric-> CPU Utilization time) is an average (probably) of the usage calculated considering all the instances.

For example, if instance 1,2 and 3 uses 7m of 70m each, instance 4,5 uses, 14m of 70m each, then average would be at any given point in time would be (10% + 10% + 10% + 20% + 20%)/5, which would result in 14% CPU Utilization Time at any given point in time.

Let me know if this is correct or not? Also, what does time signify here?

Any inputs? This is critical for us at the moment to monitor our service efficiently.

Hey @siddhant.agarwal

CPU Utilisation Time %% is a metric of how many timeslices chunks are being used by processes on the JVM.

If your Infrastructure agent is installed on the same JVM, then the metrics in ProcessSample should be the same or similar.

I believe your understanding below is correct:

For example, if instance 1,2 and 3 uses 7m of 70m each, instance 4,5 uses, 14m of 70m each, then average would be at any given point in time would be (10% + 10% + 10% + 20% + 20%)/5, which would result in 14% CPU Utilization Time at any given point in time.

1 Like

Let me summarize it:

So, the CPU Utilisation Time % is the percentage of timeslices utilized by the process on the JVM. And this percentage is calculated as follows:

If out of total available CPU(let’s say 700m), 70m is assigned to the JVM for usage and the process on the JVM utilizes only 7m out of 70m, for this alert metric(APM-JVM Cpu Utilisation Time%), the value would be reported as 10%(based on the capacity assigned: 70m) and not 1%(based on total CPU Capacity: 700m), Correct?

I believe that is correct, yes.

Thanks Ryan for the clarification. That clears it.

What is the definition of timeslice?

Hi @vitaly.grinberg1

The dictionary definition of timeslice is:

the period of time for which a process is allowed to run uninterrupted in a pre-emptive multitasking operating system