My Oracle Support Banner

Oracle Linux: Inconsistency Between "ps" and "top" Command Output for %CPU of Processes (Doc ID 2075642.1)

Last updated on AUGUST 29, 2023

Applies to:

Linux OS - Version Oracle Linux 5.10 with Unbreakable Enterprise Kernel [2.6.32] and later
Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64
Linux x86

Goal

Why CPU usage for processes shows different for ps and top commands.

ps command showing 8 processes are above 90% CPU most of the time:

[oracle@<HOST> ]$ ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
%CPU PID USER COMMAND
98.8 33 root [migration/7]
98.5 13 root [migration/2]
97.7 8 root [migration/1]
97.2 17 root [migration/3]
95.6 21 root [migration/4]
93.1 25 root [migration/5]
92.0 6 root [migration/0]
91.9 29 root [migration/6]
1.7 52830 oracle oracle<DBNAME> (LOCAL=NO)

On the same time, top command is not showing any process utilizing the CPU with more than 1%:

[oracle@<HOST> ]$ top
top - 05:29:18 up 254 days, 13:27, 10 users, load average: 0.80, 0.88, 1.44
Tasks: 563 total, 1 running, 560 sleeping, 0 stopped, 2 zombie
Cpu(s): 0.5%us, 0.3%sy, 0.0%ni, 97.9%id, 1.2%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 103302740k total, 81192632k used, 22110108k free, 764272k buffers
Swap: 36700156k total, 329780k used, 36370376k free, 22772280k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
50651 oracle 20 0 29.8g 38m 30m S 1.0 0.0 8:59.40 oracle<DBNAME> (LOCAL=NO)
8392 root 20 0 110m 2556 1896 S 0.7 0.0 534:25.24 /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7
8687 grid 20 0 433m 30m 12m S 0.7 0.0 1597:27 /u01/app/grid/product/11.2.0/grid/bin/oraagent.bin

 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.