Dmitri Tikhanski is a Contributing Writer to the BlazeMeter blog.

Become a JMeter and Continuous Testing Pro

Start Learning
Slack

Test Your Website Performance NOW!

arrow Please enter a URL with http(s)
Aug 27 2015

Controlling the Number of Hits Per Second in Performance Tests Using Taurus

 

This post is part of our continuing series on Taurus, an open source test automation tool that extends and abstracts JMeter, and helps to overcome various challenges. Taurus provides a simple way to create, run and analyze performance tests. In the previous posts we looked at a general overview of Taurus, and how to work with multiple tests. Here we demonstrate how easy the process is in Taurus to defining the desired throughput in requests per second. 

 

For the previous articles on Taurus:

 

 

Controlling the Number of Hits Per Second in Performance Tests Using Taurus

 

 

Defining Throughput Through Taurus YAML Files

 

Two of the most common elements used to measure success in load testing are:

 

  1. the number of concurrent users
  2. the number of requests per second

 

Taurus supports both:

 

  • The number of concurrent users via the concurrency key
  • The number of requests per second via the throughput key

 

Let’s highlight the process of defining the desired throughput in “requests per second” (RPS).

 

In some load testing scenarios, you need to know how many requests per second your application under load can handle (within acceptable response times), Attempting to determine it by tinkering with ramp-up and think times can be time consuming and not always accurate. JMeter provides the Constant Throughput Timer and the JMeter Plugins project offers Throughput Shaping Timer, which is a bit more advanced.

 

Taurus makes building RPS goal-oriented scenarios very simple, enabling you to precisely set the desired requests-per-second rate for your load test script.
 

Let’s start with something very basic -- a 10-user load test which hits the http://blazedemo.com website with the following parameters: a ramp-up time of 1 minute and the test duration being 2 minutes 30 seconds. The relevant Taurus YAML configuration file will appear as:

 

 

If you save the file as “throughput.yml” and run it via Taurus with the BlazeMeter reporting module enabled as:

 

bzt throughput.yml -report

 

Your test results will be uploaded to the BlazeMeter Cloud and you will be able to see detailed information on your test. Being that we’re interested in the “requests per second” bit, let take a look. 

 

 

As you can see in our case, 10 virtual users provide a load of  just under 40 requests per second. Let’s limit it to be just 5 requests per second via Taurus. It is as simple as adding just one line to the original script:

 

throughput: 5

 

 

After restarting the test, we can see that the requests throttled and the load decreased and became about 4 hits per second. It’s less than the 5 RPS we defined in the YAML file due to a 1-minute ramp-up, so the test starts with 1 request per second and the load gradually increases to 5 requests per second during the 1-minute ramp-up time. 

 

 

If we open this test in the JMeter GUI as:

 

bzt throughput.yml -gui

 

We’ll see that the Throughput Shaping Timer is added to the Test Plan and its configuration matches the ramp-up period and target throughput.

 

 

You probably noticed that the throughput is added in 2 steps:

 

  1. Increase the load from 1 to 5 RPS over 60 seconds (ramp-up)
  2. Hold the load at 5 RPS for 150 seconds (hold-for)

 

You can use the steps key in Taurus to control the number of steps needed.

 

So if I slightly modify the test and add 5 steps as follows:

 

 

Then it will result in the following Constant Throughput Timer configuration:

 

 

So all you need is just to set the number of steps, and Taurus will automatically and proportionally distribute the target throughput between steps during the defined ramp-up period.

 

As you can see, setting the target throughput in Taurus is easy and straightforward.

 

In case you face any problems or have questions you’re welcome to raise them through Taurus Support Forum as well as ask them in the comments section below.

 

You might be interested in viewing our webinar, Automating Performance Tests with Taurus, which will show a live demo of how to use Taurus for both small and large-scale tests, as well as how to integrate with CI tools like Jenkins for continuous testing.

     
arrow Please enter a URL with http(s)

Interested in writing for our Blog?Send us a pitch!