Skip to main content

How to measure the peak number of parallel users with JMeter

How to measure the peak (maximum) number of parallel users supported by your web application? It seems to be a trivial task for JMeter, however it is not so simple.

The main problem is that JMeter doesn't have a built-in feature to identify how Response Time changes with amount of parallel threads. But what if we need to measure this metric in scope of performance testing? There is a nice Response Times vs Threads plugin for JMeter. However this plugin works only with the version of JMeter starting from 2.4 and it is hard to integrate it with Continuous Integration servers. And what if we have the bunch of scripts already implemented for the older 2.3.4 version or just looking for alternative solution that is easier to integrate with our Continuous Integration server? Chronos plugin for Maven would be a good match. Integration of Maven and Chronos with JMeter had been already described in this post

This what I suggest to change in your JMeter script:

  1. In "Thread group" properties set the "Number of Threads" value to 300.
  2. Set "Stop Test Now" behavior in case of Sample error. This will help to avoid excessive requests when your application cannot handle the simulated number of parallel threads anymore.
  3. Set the "Ramp-Up Period" value to 300.
  4. Set "Loop Count" to "Forever" this will simulate constant load produced by parallel users, the number of parallel users will grow +1 each second, until it reaches 300, this will be in 5 minutes.
  5. In "Scheduler" the end time must be 5 minutes after the start time, this will guarantee that the test will end in 5 minutes.

Chronos report will include response time over time graph and the graph that shows the number of active threads. If we compare both graphs we can see what response time corresponds to what number of parallel users. This approach helps us to find the peak number of parallel users that leads to performance degradation where the response time is becoming lower than the acceptable level for our web application. This level can be different for different pages depending on their functionality. This is a simple strategy for JMeter to find the maximum number of parallel users supported by web application. You can play with the configuration a bit, for example you could try to increase ramp-up period, decrease or increase number of threads, this will help you to match the configuration with your test environment.

Popular posts from this blog

Switching between keyboard layouts in Openbox (Arch Linux)

Switching between two (or more) keyboard layouts in Openbox DE is a task that's quite easy to accomplish, although it might not be so obvious as in other desktop environments. This solution was tested on Arch Linux. You just need to edit this file (assuming you want to switch between English and Ukrainian Phonetic layouts with Alt-Shift): /etc/X11/xorg.conf.d/01-keyboard-layout.conf Section "InputClass" Identifier "keyboard-layout" Driver "evdev" MatchIsKeyboard "yes" Option "XkbLayout" "us,ua(phonetic)" Option "XkbModel" "pc105" Option "XkbOptions" "grp:alt_shift_toggle" EndSection If you have Nvidia card, don't forget to edit /etc/X11/xorg.conf.d/20-nvidia.conf and change Driver from "kbd" to "evdev" in InputDevice section: Section "InputDevice" Identifier "Keyboard0" Driver "evdev" EndSection Y...

How to control CPU frequency on Linux Fedora 20

Sometimes you need to make CPU run faster or slower, depending on your needs. In Linux you can control this by using different CPU governors. The following steps were tested on Fedora 20, but most likely they would also work on later versions of Linux Fedora OS. sudo yum install kernel-tools Check the available CPU governors: sudo cpupower frequency-info --governors sudo cpupower frequency-set --governor [governor] More information about the governors here: http://docs.fedoraproject.org/en-US/Fedora/20/html/Power_Management_Guide/cpufreq_governors.html

How to run Jekyll server on Cloud9

So you already have your Cloud9 account and your Jekyll site is in your workspace. Now you want to run the server. It is actually very simple. In a fresh Could9 workspace you only need to execute the following two commands in the terminal window: gem install jekyll jekyll serve --host 0.0.0.0 --port 8080 After executing these two commands you can open your site in the browser using the following link: https://[workspacename]-c9-[username].c9.io Important note: Only port 8080 works for me in Cloud9, other ports are closed. Also assigning host to 0.0.0.0 is necessary.