Stresser is a large-scale stress testing framework consists of one Commander (client) and an arbitrary number of Soldiers (servers).
By broadcasting a pre-defined task, the Commander can trigger all Soldiers to generate workloads concurrently.
A task can be:
- Sikuli - Great for tests based on GUI operations.
- script - e.g.
script.sh
on Unix-like systems orbatch.bat
on Windows. - bin - Binary executables.
To generate more stress, just add more Soldiers.
You can install Stresser by pip
:
pip install stresser
Once you've got Stresser installed, prepare configuration files for the
Commander and Soldiers. Then run stress-commander
and stress-soldier
respectively.
A sample configuration file for Soldiers:
[amqp]
# The AMQP server for message broker
server = 5.5.6.6
[bin]
# Path for Sikuli's runIDE.cmd
sikuli_cmd = C:\sikuli\runIDE.cmd
# Path for Shell (*nix systems only)
shell = /bin/zsh
Start listening tasks:
$ stress-soldier soldier.conf
[x] Soldier bd88148e-fa36-4017-ac5b-099ba83570fe is awaiting RPC requests
...
A sample configuration file (with a Sikuli task defined) for the Commander:
[amqp]
# The AMQP server for message broker
server = 5.5.6.6
[task]
# Task name
name = The First Task
# Task type, e.g. sikuli, script and bin.
type = sikuli
# URL for executable which will be downloaded by Soldiers
url = http://5.5.6.6:8000/first.skl
# The number of Soldiers. Commander will stop when the specified number of
# results have got.
count = 32
Start broadcasting task:
$ stress-commander commander.conf
[x] Broadcasting task: 'The First Task'...
After the Commander broadcasting a task, Soldiers are wake up to download and perform that task. You may see following messages on the Soldiers's console:
[x] Soldier bd88148e-fa36-4017-ac5b-099ba83570fe is awaiting RPC requests
[.] Discoverd task: 'The First Task'
[.] Downloading task executable from http://5.5.6.6:8000/first.skl
[.] Running task: 'The First Task'
... (some outputs for task)
[.] Task: 'The First Task' is completed
On the Commander's console:
[.] Solider dfbe093d-54e0-4b6d-adb3-6935f3c6a31e took 0:12:02 to complete.
[.] Solider 1bcfb3e2-dd69-4957-ab6d-be91422c44f7 took 0:12:03 to complete.
... (skipped)
[.] Soldier bd88148e-fa36-4017-ac5b-099ba83570fe took 0:11:59 to complete.
The Commander will stop when the task is done on all Soldiers, but Soldiers are still running, hence you can submit another task over and over again.
You only have to deploy a message broker which speaks AMQP.
Stresser follows Semantic Versioning, both SemVer and SemVerTag.