how to find all processes cpu utilization & the cpu processor in linux?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to find all processes cpu utilization & the cpu processor in linux?
I need a command to list all the processes running in a server and its cpu utilization and the respective processor it uses (means cpu 0/cpu1) in a linux server running redhat-release 5update 2 .
Can you please help me if there is a command to do or is there any script which can help ?
Distribution: Fedora (typically latest release or development release)
Posts: 372
Rep:
As an addition to the previous post, you can use htop (you might have to install it). It functions the same way as 'top' but lets you interact with the output.
Apart from these you can always look for additional tools freely available on internet to get update on CPU and memory utilization like the one which I use are
I always start with top. It is an interactive tool and can show the top CPU users in time periods down to fractions of a second. You can add columns and it can show which CPus are getting the most usage, but it cannot show which CPU a particular task is assigned to; you should be able to infer that for tasks taking large amounts of CPU time.
I use SAR (System Activity Reporter) for long-term analysis of CPU usage, as well as many other system resource statistics. Install the sysstat package (for Fedora and RHEL related distros). SAR begins collecting data and stores it in ten-minute intervals over a five-day period so you can analyze data over long term.
I know this does not help with specific processes, but SAR is a powerful tool and can help you determine whether a performance problem is CPU, I/O or Network related.
TenTenths: How can i add the cpu number when i am executing the top in batch mode ?
ps is better for batch mode, and you can over-ride the format and add extra columns, man ps for more info, it's the psr column that shows the last processor.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.