Tuesday, May 30, 2023

TOP command is not showing the processes in a right order

Problem:

I came across a weird problem where top Linux command is not sorting the processes by the top consumer processes under oracle user, but when running top Linux command with any other user it sorts the processes in a right order.
If you still unable to understand the issue, look at this screenshot which shows top command output under oracle user on the left side where the processes are listed randomly, and the same command output ran by opc user on the right side where the processes are sorted by the top consumers.

There is no alias being invoked for top command:

 

Analysis:

There is a file with name ".toprc" under /home/oracle saves top command settings, where it influences top command output. This file get created when you press "W" after calling top command to save its current call setting:

Solution:

I've simply renamed the .toprc file and the top command output is back to its normal setting sorting the processes by top CPU consumers.

# cd ~
# mv .toprc  .toprc.old

 

Conclusion:

This is not a problem, but it's just a wrong configuration impacted the output of top command and also impacted the behavior of all monitoring script that depend on top command output for reporting the top consuming processes.

References:

https://www.thegeekstuff.com/2010/01/15-practical-unix-linux-top-command-examples/











No comments:

Post a Comment