Measuring hardware activities
During the load testing of the application, it is also interesting to measure the hardware load and check if we reach the maximum number of concurrent users or if some scenario are consuming too much resources (cpu, disk,…)
Since we are in a windows environment, the best utility to check the OS/hardware activity is Perfmon.
Perfmon is a Ms tool that allows to monitor the system activity.
It also has the the possibility to write the content of system counters in a csv file:
During a test, we launch Perfmon on all computers that participate in a load testing session:
- Application server
- Oracle Database
- Jmeter
The most important variable to monitor are : CPU, disk read bytes, disk write bytes disk queues and network read/write.
The reason to also include the Jmeter server is to make sure our measures will be accurate and Jmeter server has not been saturated (cpu too high, inducing latency in samples).
To launch Perfmon on a remote server, you can either use psExec or logman command line utility.
All data are collected in CSV file and GNUplot can easily display graphs:

The GNUplot script used to generate the above graph:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
set terminal png small set datafile separator "," set xdata time set timefmt "%m/%d/%Y %H:%M:%S" set format x "%H:%M" # set ylabel "Label Y" set format y "%.2f" set yrange [0:100] #Assume the cpu column in perfmon csv file is the 8th set output 'jboss_perfmon_processor.png' set title "Jboss CPU" #Compute the cpu average during the run throughput=`awk 'BEGIN { FS = "," }{ gsub(/"/,"",$8);s += $8; cnt+=1 } END { print (s/cnt)}' perfmon-jboss.csv` set label "Average = %f", throughput at graph 0.02,0.9 front plot "perfmon-jboss.csv" using 1:8 title col with lines |
Measuring JVM activity
The JVM activity can be monitored by adding some flags :
|
1 |
Java -verbose:gc -Xloggc:garbage.log … |
This will generate a file garbage.log containing informations regarding the garbage collection activity:
13.934: [GC 36728K->2824K(1034048K), 0.0123222 secs]
13.947: [Full GC 2824K->2799K(1034048K), 0.0504033 secs]
20.420: [GC 90223K->9323K(1034048K), 0.0242522 secs]
23.745: [GC 96747K->19222K(1034048K), 0.0474630 secs]
24.134: [GC 27168K->20613K(1034048K), 0.0381792 secs]
24.172: [Full GC 20613K->20538K(1034048K), 0.1359290 secs]
…
An entry like:
13.934: [GC 36728K->2824K(1034048K), 0.0123222 secs]
Means that at 13.9 sec from the jvm startup, memory heap was 36728K and has been garbaged for 0.012 secs. After the garbage, the heap usage was reduced to 2824K.
Using a python script to convert to csv and with the help of GNUplot, we can draw a graph of the JVM activity:
The last part of this article will explain how to combine load testing and visualization tools together to perform a complete simulation.


[...] This post was mentioned on Twitter by Stéphane Nicoll, BSB labs. BSB labs said: [blog] Load testing enterprise applications efficiently (2/3). http://bit.ly/fjGYdG [...]