?
Solved

How to effectively measure CPU utilization in Unix?

Posted on 2015-02-15
4
Medium Priority
?
150 Views
Last Modified: 2015-02-18
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
Comment
Question by:Errang Genevre
[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
4 Comments
 
LVL 19

Assisted Solution

by:simon3270
simon3270 earned 668 total points
ID: 40610694
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
 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 664 total points
ID: 40611380
You could try htop (if you have that installed), it's more advanced than top and has a more friendly interface.
0
 
LVL 32

Accepted Solution

by:
Kamran Arshad earned 668 total points
ID: 40613581
Hi,

Monit is a decent option so is Htop;

http://mmonit.com/monit/
0
 

Author Closing Comment

by:Errang Genevre
ID: 40616093
Thanks!
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

762 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