LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-20-2012, 07:56 AM   #1
mikevanhoff
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Rep: Reputation: 0
Performance


I am running RedHat Linux 6.1 64bit in a virtual environment. 2 CPUs 4GB RAM.
I have been seeing 12 to 14 hour spikes in CPU utilization, but have not been able to pinpoint WHAT process(s) is using the CPU.
Can sar give me this information> If so, can someone give me an example command, and how to interpret the output?
If sar cannot give me this information, is there another tool that can?

Thanks in Advance
 
Old 01-20-2012, 08:10 AM   #2
nonamedotc
Member
 
Registered: Mar 2011
Posts: 343

Rep: Reputation: Disabled
You could try using the command top to see which processes are eating up the CPU. I do not know what the command sar is but top is what I use.
 
Old 01-20-2012, 08:44 AM   #3
mikevanhoff
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Top would only be good if I happen to be there.
I need to find out what process was causing the spike at the time of the incident.
Any ideas would be good
 
Old 01-20-2012, 10:07 AM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,916

Rep: Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777
Quote:
Originally Posted by mikevanhoff View Post
Top would only be good if I happen to be there.
I need to find out what process was causing the spike at the time of the incident.
Any ideas would be good
Any ideas? Well, use, eg top from a script that captures a lot of sequential top outputs, and look at the top outputs when the load spike happened.

Quote:
seeing 12 to 14 hour spikes in CPU utilization
It makes a bit of a difference if you mean a short spike every 12 - 14 hours, or a spike that lasts 12 - 14 hours. Which?
 
Old 01-20-2012, 10:26 AM   #5
nonamedotc
Member
 
Registered: Mar 2011
Posts: 343

Rep: Reputation: Disabled
Quote:
Originally Posted by salasi View Post
Any ideas? Well, use, eg top from a script that captures a lot of sequential top outputs, and look at the top outputs when the load spike happened.
Exactly. This is what I meant. Sorry for not being clear.
 
Old 01-20-2012, 10:35 AM   #6
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,425

Rep: Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159
Does the load spike occur in the middle of the night, say, when a cron job might be running?
 
Old 01-20-2012, 10:39 AM   #7
mikevanhoff
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by salasi View Post
Any ideas? Well, use, eg top from a script that captures a lot of sequential top outputs, and look at the top outputs when the load spike happened.



It makes a bit of a difference if you mean a short spike every 12 - 14 hours, or a spike that lasts 12 - 14 hours. Which?
the last spike lasted 12 hours. I am not worried about short spikes - that would be normal work.

I will give the top script idea a go, and hopefully the incident will repeat itself.

Thanks all.
 
Old 01-20-2012, 05:00 PM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,916

Rep: Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777Reputation: 777
OK, sorry, my last reply was a bit curt, but I was in a bit of a hurry; here are a few more fragments;
  • if you look at the top man page, there is a non-interactive option, and that writes an ordinary top page, but only a single page, and it sounds as if that is what you want, and you probably want to append that to your capture file
  • you also probably want to write something that tells you what things looked like, from a system point of view, at the time; one possibility is to write an accompanying 'uptime' to the file; while it doesn't sound as if you are interested in the uptime, per se, uptime also contains the clock time and the load average numbers, and those you are interested in
  • so, my impression is that you might want to append an 'uptime' and a 'top' from a script, and maybe run the script that does this again and again from a cron job, say every fifteen minutes (or faster or slower, depending on how much resolution you need and how big a file that you feel like building...with time periods like this, it probably isn't a big problem, if you are looking for, say, sub 100 mS pulses, everything changes, both because of the amount of data, if you leave it for a couple of days, and because you probably wouldn't want to use the cron job option, in that case)
  • an alternative would just be send the script to sleep, rather than a cron job
 
  


Reply

Tags
performance, sar


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cp performance sand7000 Linux - General 1 09-07-2011 05:21 AM
Software Raid 6 - poor read performance / fast write performance Kvothe Linux - Server 0 02-28-2011 04:11 PM
Lighttpd performance problem + RAID performance problem in a high load site phaz0r Linux - Server 0 11-16-2008 09:52 AM
LXer: Performance Technologies Announces Availability of AMC121 High-Performance Comp LXer Syndicated Linux News 0 09-18-2007 11:30 AM
performance exvor Programming 12 08-01-2005 05:41 PM


All times are GMT -5. The time now is 05:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration