?
Solved

top memory and cpu consumers on Linux

Posted on 2010-09-17
3
Medium Priority
?
599 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
joseleonardo earned 1000 total points
ID: 33703966
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 1000 total points
ID: 33703982
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
ID: 33704061
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 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