Creating and running load tests

mpermar edited this page Jan 25, 2012 · 7 revisions

Rayo Load Tests is a project hosted at Github that can be used to load testing a Rayo based deployment. The project does use The Grinder, a wonderful load testing framework based in Jython and which makes really easy to automate load testing.

Jenkins Load Testing

Our load testing suite runs from our Jenkins box. Jenkins does have a plug-in for The Grinder which shows very nice graphics for each load test execution. That way it is very easy to compare performance across different builds.

See an example here

Creating a Test Script

In The Grinder you create load test scripts using Python. We have taken a very pragmatic approach with regards load testing. We could have created our load test scripts from scratch. But we already had a very large set of functional tests available. So instead we choose to implement a simple script that will run a specific functional test designed for load testing. This is possible because The Grinder includes by default support for executing JUnit tests, so in fact this is a very simple task.

Here you can find the Python script that executes the load test which is no more than 90 lines long. This test will execute this load test which basically executes a few Rayo operations like Input, Output or Record.

To configure the behaviour of the load testing framework you only have to edit the grinder.properties configuration file. On this file you can easily set up the number of concurrent threads that will execute the functional test as well as the number of test executions that each thread will execute. Like for example you can create 100 threads and make each of these threads to run 300 executions of that functional test.

And that is it. If you want stress your own Rayo setup then you should already have all the available pieces. Note that you can also easily modify the Python script to run multiple functional tests or just modify the functional test used for load testing to run a completely different and more complex scenario if you wish. There is plenty of possibilities!