Score:0

Is 'Max Cpu' at 100% normal?

tc flag

Below are two images from our Azure 'App Service Plan', which hosts our application. We recently tried scaling up, but it did not solve the issue seen below.

Our 'Max CPU' peaks throughout the day, everyday..but this is the MAX aggregation. These are transient spikes. Meanwhile, our AVG aggregation of cpu percentage is normal (second photo).

Is it expected to have max cpu transient spikes, like seen in the first picture, or is this abnormal?

Thank you!

Max CPU max cpu

Average CPU average cpu

Score:1
cn flag

It's aggregation rule, not the actual usage. When metrics are collected, they have (for CPU) a single metric: current CPU load. If metrics are collected 6 times a minute, there are 6 values. When large interval is shown, it's usually does not show all data, but perform aggregation. F.e. if aggregation is down to 10-minute interval, than all data in this interval are collapsed into one number. There are different functions to do so: min, max, avg, median, etc.

One away is to average (your second chart). Another is show the maximum found peak on that interval (your first char). Aggregation on averages tends to hide peaks, aggregation on max'es tends to swell peak use unreasonably. If you have 10 minutes aggregation window, and during this moment some process consumed 100% for 0.1 second, and that 0.1 second was the moment metrics were gathered, you'll have 10-minute interval of 100% CPU use (when 'max' aggregation is used).

tc flag
This helps me understand what I'm seeing (it will aggregate max cpu within the specified aggregation timeframe), but does not help me understand if this behavior is expected in normal circumstances. I guess we should look into exactly what's causing the transient spikes?
George Shuklin avatar
cn flag
I usually have atop installed on server. It very coarse (15 minutes samples), but it records tons of historical information, including PIDs of processes, their command line and CPU consumption. It's a bit hard to get used to it (Use '?' for help), but as soon as you familiarize yourself with it, it's a best low-invesment emergency investigation tool I saw.
Score:0
vn flag

That depends a lot on the application running on it. If it is doing CPU intensive work it will probably spike the CPU usage as high as it can. The difference you should see from upgrading the hardware. Is that the tasks it is working on will complete faster.

I don't know anything about the app you're trying to run. And therefore don't know if it is a multi-threaded application that seems to run as it should during these spikes or if it is a single-threaded application that seems to hang during the spike? In the first case I wouldn't bother much. But in the second case i would probably look into either upgrading the CPU evern more or, if I got access to the source code of the app try to see if it was possible to optimize the CPU intensive task.

tc flag
Thank you for your answer!
BitGen01100000 avatar
vn flag
@jamesdlivesinatree You're welcome! :)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.