• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

How to effectively measure CPU utilization in Unix?

Hello,

I'm trying to determine how much stress a process puts on the CPU in GNU/Linux.

I've tried the 'top' command; but that doesn't save the details I need; and also it shows percentages that are greater than 100% on multiple processes, so I'm not sure how to utilize it properly.

Are there any shell/python scripts I could use to accomplish this?

Appreciate any help on this!
0
Errang Genevre
Asked:
Errang Genevre
3 Solutions
 
simon3270Commented:
Depending on your Linux version you may be able to use "top -b" to run top repeatedly but just stream the output rather than do it page by page.  You redirect that to a file for later analysis.

As for the cpu percentage,  just divide by the number of cpus to get it to a 0-100% range.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
You could try htop (if you have that installed), it's more advanced than top and has a more friendly interface.
0
 
Kamran ArshadIT AssociateCommented:
Hi,

Monit is a decent option so is Htop;

http://mmonit.com/monit/
0
 
Errang GenevreAuthor Commented:
Thanks!
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Tackle projects and never again get stuck behind a technical roadblock.
Join Now