Sar during a test


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Sar during a test
# 1  
Old 07-11-2014
Sar during a test

Hi All,
I am trying to run sar on a Redhat server during a test I am performing for a couple of hours. I would like to get the sar metrics for every second (instead of the regularly set up 10 minute interval in the cron). What is the most efficient way to do this?

Thanks,
Shahzad
# 2  
Old 07-11-2014
What are you trying to do? It's impossible to say what's "most efficient" without knowing what your goals are.

In general, I'd recommend testing sar on your hardware to ensure it can sample that fast. If it takes more than one second to collect a sample, you'd probably be better off sampling ever 2 or even 5 seconds.

If you do need to sample that often, read the man page(s) and other documentation and see if you can limit what is being sampled.
# 3  
Old 07-11-2014
Yes, I am thinking 1 second might be too much for sar, I will go with 30 seconds or even a minute. What I want is a sar data file created for a period of couple of hours while I perform some tests instead of the 10 minute gap the cron job currently is set up for.
# 4  
Old 07-14-2014
If your process runs for a couple of hours, then the sample interval should reflect this, else you will end up with too much details to make a good judgement from.

If you ask it to sample at 30 seconds for 120 repetitions, you will get an hour's data. I suppose you can graph (with Excel or similar) the data:-
Code:
sar 30 120 > /tmp/my_sar_output

You will need to consider what options to set for whatever you want to measure.

If you bring the sampling down to a single second, or even two seconds then there is a risk that the sar processing will skew your results, a bit like putting a thermometer in a mug of hot coffee will actually cool it a little and tell you what the temperature has now become, not what it was.



Robin
# 5  
Old 07-14-2014
I think I see what you mean. The 30 seconds I can change to all the way up to 2 minutes if that will reduce the sampling impact of the sar.
# 6  
Old 09-11-2014
To get all the sar data for 2 hours at 30 minute interval and a place graph look on the web for a plae to graph it. I can't post URLs, because I'm a newbie here.

Code:
 
sar -Ap 30 240> /tmp/$(hostname).sar

.
# 7  
Old 09-13-2014
Oh, don't forget to configure sar to include disk utilization. It varies on how you do it based on the release, even within a release.

On redhat 5 add the following to /etc/sysconfig/sysstat

SADC_OPTIONS="-d -I"

---------- Post updated at 09:10 AM ---------- Previous update was at 08:19 AM ----------

To graph sar data run
Code:
sar -Ap 30 240

and send the output to a file. Then go to Sar Grapher to graph it out. It has mouse overs and zooming, pretty nice.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Prefixing test case methods with letter 'test'

Hi, I have a Python unit test cases source code file which contains more than a hundred test case methods. In that, some of the test case methods already have prefix 'test' where as some of them do not have. Now, I need to add the string 'test' (case-sensitive) as a prefix to those of the... (5 Replies)
Discussion started by: royalibrahim
5 Replies

2. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

3. AIX

SAR

I am running below script to display last 48 hour data but the output is not displaying heading - AIX eqrdb26u1 1 6 00CFD5E34C00 01/21/10 System configuration: lcpu=8 ent=2.00 mode=Uncapped 22:31:40 %usr %sys %wio %idle physc %entc and footer - Average 25 9 ... (1 Reply)
Discussion started by: noorm
1 Replies

4. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

5. HP-UX

Sar

Hey guys in sar -v 5 5 command what is the proc means. (1 Reply)
Discussion started by: sbn
1 Replies

6. Filesystems, Disks and Memory

sar

We have a script that uses sar -u 1 10 | awk '/Average/ { print ( $2 + $3 ) }' to get the CPU usage of a mutli engine machine. We think we are getting wrong information from the above string. We think it is adding up the total of the 12 engines and reporting back the total not the overall... (5 Replies)
Discussion started by: kevinb
5 Replies
Login or Register to Ask a Question