Score:-3

Why sum of all process CPU(%) is greater than total cpu(%) utilisation in top command

sg flag

In a top command instance, the CPU utilisation (100-idle) was 14% but the top most process "Chrome" alone consumes 253%. I am unsure of how the chrome process consumes CPU more than 100%.

Some answers show that its because of multicore system and we should turn off IRIX mode for that.

If thats right, I want a solution to turn off IRIX mode in batch mode since my task relies on running top in batch mode. Else can I manually divide each process CPU % by no of cores myself? will the answer same as tunring off IRIX mode.

Artur Meinild avatar
vn flag
You asked this already, and I provided a detailed answer.. maybe edit your original question to include operation in batch mode.
Bharath S avatar
sg flag
@ArturMeinild No I have also asks for a command line way to turn off IRIX mode and want to know about manually dividing the cpu% directly by cores. Understand the question and remove the downvote
Artur Meinild avatar
vn flag
I added details on how to disable Irix mode for batch operation both here, and in your original question.
Score:0
vn flag

These are the steps to disable Irix mode for top in batch mode:

  1. Run top in normal mode
  2. Disable Irix mode with: Shift+i
  3. Save a configuration file for the current user: Shift+w

The configuration file will be located at $HOME/.config/procps

Now, when you run top for this user (including batch mode), Irix mode will be disabled by default.

To make this the default for the root user, switch to root (with sudo -s) and run the 3 steps above.

Since top is a relatively simple program, it's not possible to run with a custom config file. If you require custom config or CPU metrics, consider using another method than top output.

Bharath S avatar
sg flag
thought of this solution too. In my case, I cant change the behaviour of top completely. It will help If the configuration file can be given as input in batch mode as I can checkin that file in my project. I want the usual top left undisturbed and "IRIX mode" less top as another version
Bharath S avatar
sg flag
Can I manually divide the cpu% of each process with no of cores? Is that same as solaris mode?
Artur Meinild avatar
vn flag
Yes I should believe so. However, the rounding will be a little different, but more or less the same yes.
Bharath S avatar
sg flag
Can we make top command use different configuration file located in diferent location. I want to give the path as a param or by any ways
Bharath S avatar
sg flag
I am confused now. If a prcoess shows cpu% as 40% it means its (40/16) % on a 16core server? Does a process spawn all the core +/- equally all the time?
Artur Meinild avatar
vn flag
Please - this is not a discussion forum...
Bharath S avatar
sg flag
Then how can I arrive answer for my question, You skipped a part of the question hence I asked and you are makring question as duplicate and prevent me from asking others too
Artur Meinild avatar
vn flag
I elaborated on the current limitations of top. Maybe you should consider another alternative to top.
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.