Score:0

How to calculate CPU utilization for an application in a multicore system

de flag

On 8-core server, 0-3 are configured as isolcpus and remaining cores (4-7) are available for system and user processes to run. My application has multiple processes which will run on any one of the mentioned non-isolcpu cores (4-7).

I need to find the total CPU utilization of the application (all processes combined) to determine the right isolcpus range to be configured for the system.

I'm quite confused about this way of calculating CPU utilization for a process or group of processes. Can somebody enlighten me in laymen terms? Thanks!

Went through related questions as well, none of them helped: How are CPU time and CPU usage the same?

Score:0
vn flag
rvs

How to you start the application?

If you use systemd you may use CPUAccounting= setting in the unit file and systemd will collect some CPU metrics. If you don't use systemd, you may still put your application into cgroup with enabled accounting manually.

Finally, I'd take a step back and re-consider the approach to the problem you are trying to solve. There is a lot of nuance in CPU so just looking at CPU time may not be helpful. If you don't know already how many dedicated cores do you need, you may not want to use them at all. Dedicated cores are often used for very latency-sensitive applications which extensively use spin-locks and tightly control number of threads they have. Think of a things like low-latency user-space network drivers which want to avoid context switches and interrupts.

What are you trying to optimize for? Is the workload latency-sensitive? Would it be better to setting cpu limits other than dedicated cores?

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.