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.