Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Try taking a look through this site:

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

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:

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

Your Answer


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.