Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CPU performance 2

Status
Not open for further replies.

AIXUser53

IS-IT--Management
Aug 16, 2002
47
US
Hi all,

What is the best way to capture CPU Performance trough out the day and save it in a log file. I have been using
ps aux , but it can only capture once. I don't know how to set the command to capture like every 5 minutes.

Any Idea would be helpful

Thank you in Advance.
 
Using `sar` would be the best choice for your activity. Using `ps` you would have to write a script to sleep for 5 minutes and loop.
 
The only reason I want to use ps command is to check to see which user at what time processing and usign how much % of the CPU.

 
while true
do
ps aux > /tmp/filename
sleep 300
done

This will continue until you break (Cntrl-C).
 
And possibly place the above script in your crontab so that it runs every five minutes:

00,05,10,15,20,25,30,35,40,45,50,55 * * * 0-6 <script>

Bear in mind, though that this will produce quite a lot of data and you might wish to periodically zap the log file to avoid it getting too large. HTH.
 
you can try vmstat also... It is also a goot command to analyize CPU Utillization
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top