Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I want to do performance testing in linux environment for a C++ application. I need to measure the CPU usage, Memory usage of the application. This application is a multi threaded application.

In this requirement I came across two Tools/Utilities (sar and top). My problem now is if I want to monitor cpu usage by user I can use top utility for this but not sure if this is available in sar utility. If I am wrong on my approach please direct me to the correct path on how to do performance testing in linux environment.

As a end note I use putty to login to the remote linux machine thus any GUI based tool will not help me.

Any help will be of great use to me.

share|improve this question
    
So are you just asking whether sar can measure performance on a per-user basis? –  user246 Jul 17 '13 at 11:41
add comment

2 Answers 2

Try taking a look through this site:

http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html

A little over half-way down is some 'ps' stuff that is probably helpful. The biggest problem with top is that it's a pain to run and parse as part of a bash script and I'd definitely recommend that you want to hit these commands, parse them, and collect the data over time so you can look for spikes and trends.

sed and awk will be your friends in parsing that data. I'm not sure what your comfort level in linux is, but if you're not familiar with those commands, I'd take a little time to learn them.

share|improve this answer
    
Hi, I was more interested in getting to know the performance of the application in terms of CPU utilization, Disk usage and IO. So I used pidstat command. But I came acrossa set of values as below minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s 49 0 217532 18784 0.01 -1 -1 -1 –  Subiah R Nagarajan Jul 22 '13 at 5:10
add comment

I upvoted Daniel's answer, another approach would be to set up a monitoring tool like Graphite to monitor and keep historical data for you. This is also useful in terms of monitoring/alerting for your product in general: http://graphite.wikidot.com/start

share|improve this answer
    
Thanks Sam woods for the reply and support to your fellow community member. –  Subiah R Nagarajan Jul 22 '13 at 5:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.