Solved

top memory and cpu consumers on Linux

Posted on 2010-09-17
3
582 Views
Last Modified: 2012-05-10
I would like to know if there is a command i can output to a file which will report the top memory and cpu consuming processes on a server (Linux).  top command is useful but i am not familiar with it to the point to where I can clearly report the top 5 or 10 consuming processes and with a clear indication of the "impacting" processes in question.

Thank you
Rich
0
Comment
Question by:newtontech4
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
joseleonardo earned 250 total points
Comment Utility
Hi, a command would be this

root@localhost#top -bn 1 | head -13 | sed -re ':l;s/^ //;tl;/^[^0-9]/d' >> top5.txt

another form will be

root@localhost#top -bn 1 | head -13 >> top5.txt

0
 
LVL 6

Assisted Solution

by:Jelcin
Jelcin earned 250 total points
Comment Utility
top -b -d 1 -n 5 > top

this command tells top to run in batch mode "-b" have an delay of 1 second "-d 1" between screen refreshes with "-n 5"  5 iterations. The "> top" pipes the result in the file top.
0
 
LVL 6

Expert Comment

by:Jelcin
Comment Utility
By default, the process status output is generated with the most CPU-intensive processes at the top of the listing. "info top" gives you more information about the top command.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
LDAP find expired users 8 41
Issue to mail 11 36
Oracle 12c patching 1 28
AWS CLI issues with Tags 3 24
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now