0

What is the reason for the following discrepancy between Ubuntu Linux 16.10 System Monitor % CPU utilization and ps pcpu, % CPU utilization with respect to the individual Firefox browser process?

For the Firefox browser app , I get 2.8 % pcpu from ps -eo pid,rss,c,pcpu,cmd while for the same Firefox browser app, the GUI Application, Ubuntu System Monitor, show 0 % CPU utilization.

May I ask why this difference?

An Unix Linux Stack Exchange expert's , @DopeGhoti, hypothesis about this difference is:

it could be that ps is reporting actual CPU usage at that moment, but the GUI application could be showing aggregate usage over the last n seconds, or possibly rolling in CPU usage from children or iowait usage.

Could someone expand on this hypothesis?

Any help is greatly appreciated.

0

After testing @DopeGhoti's hypothesis for an hour using an Firefox process

"It could be that ps is reporting actual CPU usage at that moment, but the GUI application could be showing aggregate usage over the last n seconds, or possibly rolling in CPU usage from children or iowait usage"

I found it is basically correct except ps measures actual CPU utilization like this:

If I know the length of time my processes have been running (the sample period), their actual '%cpu' values can be calculated as follows:

'CPU TIME' accumulated during the sample period ----------------------------------------------- x 100 length of sample period

I discovered that Ubuntu Linux 16.10 System Monitor's % CPU utilization 's figure for the Firefox process is very sensitive to System Monitor Preferences: 1. Update interval in seconds, n .In other words, aggregate usage over the last n second 2. Divide CPU usage by CPU count, I use a quad core CPU on an Lenovo Thinkstation desktop.

In summary, the longer the time period over which aggregate usage

is measured, the more accurate is the CPU utilization measurement.

| improve this answer | |
  • @DopeGhoti, It is necessary to make sure that update interval is the same for top -b -d n | grep firefox and Ubuntu Linux 16.10 System Monitor GUI. Thank you. – Frank May 13 '16 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.