CPU Utilization

For the same process, I noticed different values for CPU utilization in the output of ps and top. Trying to understand the reason, I found the following to answer my query:

  • ps defines pcpu (%cpu) as the CPU time used divided by the process run time and expressed as a percent, i.e. the cputime/realtime ratio.
  • Top defines %cpu as the share of elapsed CPU time expressed as a percentage.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s