Load Testing ConfluenceThis page contains scripts and hints on load-testing your Confluence installations. IntroductionBefore making a new Confluence instance available to your users it is useful to get a feel for how it will perform under your anticipated load and where you may need to consider improving your configuration to remove bottlenecks. Likewise, before making changes to your Confluence instance it would again be useful to assess the impact of these changes before making them live in a production context. This kind of testing is not an exact science but the tools and process described here are intended to be a straightforward, configurable and extensible way of allowing you to begin this kind of load testing. It will rarely be the case that these scripts will perform representative testing for you 'out of the box'. But either through configuration or by extending the scripts it should be possible to build an appropriate load test.
|
|
Setup
You will need the following -
- A Confluence server, set up and running with an admin user. The scripts assume a default username and password for this user: 'admin'/'admin'.
- Ensure the Confluence Remote API is enabled in the administration options. See Enabling the Remote API for details on how to configure this.
- Apache JMeter
- The load testing scripts and resources which are available in our public Maven repository — Please choose the version that most closely matches your Confluence version and download the ZIP or Gzip file in that directory. If in doubt, download the ZIP file archive.
Users have reported problems when using the Windows built-in unzip utility. Please use a third party file archiving and extraction program (for example, 7-Zip) to extract these performance tests. |
The test scripts have been updated to work with Confluence 3.4 in version 3.4. Using an older version of the tests will result in errors when running the test.
Quick, Just Tell Me How To Run It.
If you don't want to read the rest of this document, here are the main points:
- Download and Unzip the performance tests
- Open a command prompt and change directory to the
performanceTestdirectory that has just been unzipped. Create the test data:
<jmeter location>/bin/jmeter -n -t jmeter-test-setup.jmx -Jspace.zip=<path to a demo space ZIP file> -Jadmin.user=<username> -Jadmin.pass=<password>
Run the test:
<jmeter location>/bin/jmeter -n -t jmeter-test-fixedload.jmx
The remainder of this document is just an elaboration of those two steps.
For information on how to use JMeter please refer to the manual |
Creating the Test Data
A known data set is required to run the testing against. By default this is the Confluence demo space (space key = DS) although this can be changed (more on this later). If you decide to use the Confluence demo space, ensure that the group "confluence-users" is able to update content in this space.
The script jmeter-test-setup.jmx is used to:
- create a set of users to be used in the test
- import the Confluence demo space for running tests against.
You should first ensure that you don't already have the demo space (key = DS) on your test instance. Delete it if you do.
Run the script from the performanceTest directory as follows:
<jmeter location>/bin/jmeter -n -t jmeter-test-setup.jmx -Jspace.zip=<path to a space export.zip>-Jadmin.user=<username> -Jadmin.pass=<password>
Where:
<path to a space export.zip>is the absolute path to the space export zip you want to be used in your testing. For example, the path todemo-site.zipas found in your Confluence distribution or source:<confluence install>/confluence/WEB-INF/classes/com/atlassian/confluence/setup/demo-site.zip
<username>and<password> are the username and password for an admin user that is able to create Confluence users and to import spaces.
By default the setup process will create 250 users — 50 each of the following formats: tstreader<n>, tstcommentor<n>, tsteditor<n>, tstcreator<n> and tstsearcher<n>. The password for each matches the username.
A typical run of the setup script will only take a few seconds.
Removing the Test Data
You can reverse the effects of the setup script by setting the remove.data parameter to true, e.g.
<jmeter location>/bin/jmeter -n -t jmeter-test-setup.jmx -Jremove.data=true -Jadmin.user=<username> -Jadmin.pass=<password>
Setup Script Parameters
You can modify the behaviour of the setup script via JMeter parameters. These are supplied on the command line in the form -J<parameter name>=<parameter value>.
Parameter | Default | Explanation |
|---|---|---|
script.base | . | The absolute path to the script. Defaults to the current working directory. |
space.zip | N/A | The absolute path to space export zip file to be imported as test data. |
remove.data | false | Run the script in reverse — remove all test data. |
admin.user | admin | The admin user name used to import data and create users. |
admin.pass | admin | The password for the admin user. |
confluence.context | confluence | The confluence webapp context. |
confluence.host | localhost | The address or host name of the test instance. |
confluence.port | 8080 | The port of the test instance. |
space.key | ds | The space key for the space import that will be tested against. |
space.setup | true | Control whether the test space will be created (or removed). |
commentor.max | 250 | The number of users to be created for making comments. |
creator.max | 250 | The number of users to be created for adding pages. |
editor.max | 250 | The number of users to be created for editing existing pages. |
reader.max | 250 | The number of users to be created for viewing existing pages. |
searcher.max | 250 | The number of users to be created for performing searches. |
resource.max | 250 | The number of users to be created for downloading site resources. |
attachments.max | 250 | The number of users to be created for downloading attachments. |
Setup Script Output
On the console you will see no obvious indication of success or otherwise. JMeter will output something similar to this:
Created the tree successfully Starting the test @ Mon Apr 14 17:35:08 EST 2008 (1208158508222) Tidying up ... @ Mon Apr 14 17:35:08 EST 2008 (1208158508928) ... end of run
The scripts location/results directory will contain the file jmeter-result-setuptest.jtl. There were failures or errors if there are any assertions in this file that have the value true for the failure or error element, e.g.
Running the Test
The test script itself will put Confluence under a fixed load. Each thread group will attempt to do a certain amount of work for a prescribed period of time (30 minutes by default). This is by design so that load during test runs can accurately be compared against each other.
Execute the test as follows:
<jmeter location>/bin/jmeter -n -t jmeter-test-fixedload.jmx
Where:
<scripts location> is the absolute path to where you extracted the scripts e.g. /Users/YourName/Download/performanceTest. This is needed for the script to find its external resources.
Test Behaviour
The test has a number of parameters to tweak its behaviour but generally speaking it has the rough format of:
- 5 groups of users - readers, commentors, searchers, editors and creators.
- readers simply view a set of individual pages or browse space functionality.
- commentors add comments to a set of pages.
- searchers perform searches on a fixed set of keywords.
- editors make small additions to the end of a set of pages.
- creators add new pages to a particular space.
- Each individual user in each group will repeat for a fixed amount of time with a small pause between each request.
Note that there is no execution of JavaScript by the client. Keep this in mind if you use this test to gauge Confluence performance in a production environment.
There is also very little use of permissions in these tests. All data involved is accessible to all of the test users.
Test Script Parameters
You can modify the behaviour of the test script via JMeter parameters. These are supplied on the command line in the form -J<parameter name>=<parameter value>.
Parameter | Default | Explanation |
|---|---|---|
script.base | . | The absolute path to the script. Defaults to the current working directory. |
confluence.context | confluence | The confluence webapp context. |
confluence.host | localhost | The address or host name of the test instance. |
confluence.port | 8080 | The port of the test instance. |
create.page.prefix | Nihilist | The title prefix for any created page e.g. Nihilist00001. |
script.runtime | 1800 | The amount of time the script will run for in seconds. |
Test Thread Parameters
Parameter | Default | Explanation |
|---|---|---|
threads.reader | 15 | Number of readers. |
pause.reader | 2000 | The approximate (within 500ms) millisecond pause between reader repeats. |
threads.searcher | 8 | Number of searchers. |
pause.searcher | 2000 | The approximate (within 500ms) millisecond pause between searcher repeats. |
threads.creator | 3 | Number of page creators. |
pause.creator | 2000 | The approximate (within 500ms) millisecond pause between creator repeats. |
threads.editor | 3 | Number of page editors. |
pause.editor | 2000 | The approximate (within 500ms) millisecond pause between editor repeats. |
threads.commentor | 4 | Number of page commentors. |
pause.commentor | 2000 | The approximate (within 500ms) millisecond pause between commentor repeats. |
In version 3.0 of the tests, it's now possible to control the percentage executions of certain actions. These percentages are defined in the "Thread Details" configuration screen. |
So with the default parameters, you are emulating a load on Confluence of 33 concurrent users who will each be hitting the server approximately every 2 seconds (16 users per second).
23 of these users are read only (searchers or readers) and 10 of them are read/write — 11 read only users per second and 5 read/write users per second.
Test Script Output
During the run of the test script Jmeter will output progress to the console of the form:
Created the tree successfully Starting the test @ Fri Apr 18 00:07:39 EST 2008 (1208441259523) Display Summary Results During Run + 462 in 77.6s = 5.9/s Avg: 1564 Min: 18 Max: 33738 Err: 1 (0.22%) Display Summary Results During Run + 1338 in 189.9s = 7.0/s Avg: 3596 Min: 24 Max: 34545 Err: 0 (0.00%) Display Summary Results During Run = 1800 in 257.6s = 7.0/s Avg: 3074 Min: 18 Max: 34545 Err: 1 (0.06%) Display Summary Results During Run + 1046 in 200.9s = 5.2/s Avg: 4529 Min: 40 Max: 50461 Err: 0 (0.00%) Display Summary Results During Run = 2846 in 438.2s = 6.5/s Avg: 3609 Min: 18 Max: 50461 Err: 1 (0.04%) Display Summary Results During Run + 677 in 201.2s = 3.4/s Avg: 6638 Min: 46 Max: 27636 Err: 0 (0.00%) Display Summary Results During Run = 3523 in 618.1s = 5.7/s Avg: 4191 Min: 18 Max: 50461 Err: 1 (0.03%) Display Summary Results During Run + 561 in 197.5s = 2.8/s Avg: 8326 Min: 171 Max: 39494 Err: 0 (0.00%) Display Summary Results During Run = 4084 in 798.3s = 5.1/s Avg: 4759 Min: 18 Max: 50461 Err: 1 (0.02%) Display Summary Results During Run + 555 in 199.2s = 2.8/s Avg: 8247 Min: 160 Max: 45270 Err: 0 (0.00%) Display Summary Results During Run = 4639 in 978.0s = 4.7/s Avg: 5177 Min: 18 Max: 504







15 Comments
Hide/Show CommentsMay 22, 2008
Anonymous
You can use -Jconfluence.context=/ to test a confluence instance running at the root context of the app server.
May 28, 2008
Paul Curren
Good hint. Thanks for that.
Nov 26, 2008
Bradley Lee
Great work! Having used JMeter for a number of projects I understand the true value of these scripts. We will use them as the basis for all upgrade projects.
Sep 14, 2009
Raf Wenger
Does anyone knows how to interpret the test script output?
Display Summary Results During Run + 462 in 77.6s = 5.9/s Avg: 1564 Min: 18 Max: 33738 Err: 1 (0.22%)
What do these values represent?
Thanks!
Sep 15, 2009
George Barnett
Hi Raf, These are the summary results which are printed during the performance test. What it's saying is:
In the last 77.6 seconds, there were 462 samples at an average of 5.9/second. The Average response time was 1564ms, minimum was 18ms and maximum 33738ms. There was 1 error. And there were 0.22% of failed requests of requests as a whole.
You'll find more detailed results in the
results/directory. You can run the.jtlresults files through any number of scripts to parse them down to something more useful. For example, there's a Perl script available here. It generates PNG images and it's used like this:It does require a number of Perl libraries to run. If you are uncomfortable installing Perl libraries, you can also try loading the
.jtlfile into JMeter. Here's how:You'll now see JMeter showing you the results of your test run in a table.
Mar 18, 2010
Anonymous
i need to know how to change the admin username while running in gui mode. i cannot use the username admin because it already exits in my AD.
Mar 18, 2010
George Barnett
To change the settings, you should use the
-Jsetting on the command line as described above. If you omit the-nsetting, JMeter will start the GUI however the-Jsettings will still be in effect internally (although this isn't apparent from the GUI).It's worth noting that you shouldn't perform the actual test in GUI mode because JMeter tends to lock up due to the
Listenersrequiring a very large amount of memory in order to track the responses for the GUI. You will most certainly get in-accurate results.Mar 19, 2010
Martin Gustavsson
I tried that and it does not work as i want:
But i still get alot of errors regarding the admin, for example:
i use jmeter.sh because i wanted to set the heap.
Mar 19, 2010
George Barnett
Those locations are not controlled by the admin username, but rather by the Personal Space CSV which is located here:
You should edit this file to contain usernames that exist.
May 21, 2010
Antony Dilip Amalraj
Hello,
We are using confluence 3.0.2 at present and we performed the performance testing using jakarta-jmeter-2.3.2. I faced the following issues
1.while running the test scripts, there was 100% error. In the jmeter.log I could see the
2. While removing the test data by setting remove.date=true, the test users and the demonstraion space was not removed.
3. Also only while creating the test data, the jtl files were created in the results folder. I removed the jtl files in the results folder before running the test scripts. But after running the test script the jtl files were not created in the results folder.
This happens only in the our test regions. When executing the performance testing in my local instance i did not face any of the above issues ( except the second issue)
Any quick help on this is appreciated.
Cheers,
Antony
Jun 15, 2010
George Barnett
Hi Antony,
I would suggest contacting
support@atlassian.comfor assistance.Oct 20, 2010
Anonymous
Hi,
I need to perform the load testing but I want to use my existing data instead of the demo space. How can I do that? Is there instruction on how to do this?
In this documentation they only say:
By default this is the Confluence demo space (space key = DS) although this can be changed (more on this later).
Thanks,
Handrata
Oct 20, 2010
George Barnett
Hi Handrata,
Yes, this is possible by editing the data in the CSV files to match the locations of your pages you want to test.
Jan 18, 2012
JA
Can someone assist with reading results? Most lines like this:
Display Summary Results During Run + 235 in 21.3s = 11.1/s Avg: 1021 Min:
993 Max: 1100 Err: 235 (100.00%)
Display Summary Results During Run = 19345 in 1801.0s = 10.7/s Avg: 1022 Min:
991 Max: 2598 Err: 19345 (100.00%)
Tidying up ... @ Tue Jan 17 19:45:20 GMT 2012 (1326829520409)
... end of run
Feb 08, 2012
JA
Does anyone have advice about running this from the GUI?
Can we just load the jmeter-test-fixedload.jmx into the Jmeter GUI? And if so why wouldn't we want to?
Add Comment