Solved

top memory and cpu consumers on Linux

Posted on 2010-09-17
3
593 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 250 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 250 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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