Posted by tugis on January 23, 2012 at 7:07pm
This is not exclusively "Drupal related", but it's still useful if you want to properly find bottlenecks during a benchmark.
I want to do a test with Ab (Apache Benchmark) and I would like to monitor the memory and CPU usage during that test. What do you use for that? top command line tool?

Comments
AB is not really that good
AB is not really that good for benchmarking. You're better off using something like JMeter that can simulate numerous logged in users, comment posting, node creation, etc.
For monitoring I generally install munin and set the refresh rate up to 1 minute. I also monitor TOP while the benchmarks are running, but you get far more data from monitoring software and can go back through it and get ideas of what is running fine and what needs attention. The best thing to do with Munin is to disable things you won't be worried about and add in things you are concerned about, like MySQL. Just keep it to what is needed so you aren't having it eat up to many resources while refreshing.
HollyIT - Grab the Netbeans Drupal Development Tool at GitHub.
vmstat
We do benchmark sites for clients, and during a (say) 5 minute sustained load simulation, we do this for each server:
vmstat 30 30
This takes a snapshot of various system stats and displays them every 30 seconds.
Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.
For live servers, Munin
For live servers, we use Munin to display all system resource usage. For short benchmarks, e.g. 5 minutes, the graph does not show in a granular enough way to be useful.
Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.
You should also consider
You should also consider collectd. It collects data by default every 10 seconds versus munin's default of 5 minutes.
collectd is a great resource
collectd is a great resource and performs far better than munin in regards to performance.
We've all but gotten rid of Munin for stats collection in favor of collectd.
The only downside I've come across so far is the lack of Varnish 3 support.
+1 on collectd, but I've
+1 on collectd, but I've never used it before and wish I came across it earlier. In the past I've used the SAR variant tools with the kSar (http://sourceforge.net/projects/ksar/) to generate a nice graph for various metrics. Basically if you can measure it with sar, you can graph the data. But, it's very picky with the version of SAR (atsar won't work I think).
If you're looking for something quick and dirty this might help "visualize" some metrics.
Thanks all for the tips! They
Thanks all for the tips! They were really helpful ;)
I checked "collectd" and I liked it. Has less stuff then Munin and I found it easier to configure. Plus, the shorter refreshed data and the possibility to "plug in" different data visualization tools (collectd doesn't have its own data viewer).
For that, I liked "Visage" (http://auxesis.github.com/visage/). It uses mootols and highcharts so you have really rich visualizations. You can navigate through a graph and see the actual results in every point. That's also great!
I also tried JMeter and liked it very much. It's quiet easy to get started and following this tutorials (http://www.johnandcailin.com/blog/john/load-test-your-drupal-application... , http://www.johnandcailin.com/blog/john/load-test-your-drupal-application...) I'm already able to make test benchs with authenticated user interactions.
I was impressed with the possibility of creating tests right from my browser navigation, through a Proxy connection to JMeter! That is described in the 2nd link.
Results from Ab and JMeter are quiet different (Ab times are much shorter) but I guess it's understandable because in JMeter you can come much closer to the browser times that users get.
I can't say that I'm in love
I can't say that I'm in love with any of the frontend tools that I've tried, and I've tried nearly all of them including visage and jarmon. http://collectd.org/wiki/index.php/List_of_front-ends
I always go back to php-collection by Bruno Prémont which is part of the collectd package. It does need more time ranges, but those are simple to add in the config.php.
I've been meaning to test http://github.com/jssjr/collectd-write_graphite with http://graphite.wikidot.com/. The graphite backend data is supposed to be an improvement over RRD files which Munin and Collectd both use by default. Unfortunately, that would mean starting from scratch with regard to data though.
Graphite can read RRD
Graphite can work seamlessly with RRD's, just drop them in the proper directory, and each DS in an RRD shows up as a Graphite metric. Whisper is the format that carbon writes to, but if you have a bunch of RRD's laying around, you don't have to lose all that data.
Im also in the same boat
Im also in the same boat today and read though all the links on the page.
I need to really benchmark json --> services api --> drupal adding data based upon the incoming json, anyone know of a good way , I would like to potentially send x number of requests by x number random of people to that service api , then on return see how long this took and then what the mysql query, cpu, memory and disk io graph looks like..
I'm going to look into jmeter today but have no idea how to write such a test.. any thoughts?