-
Notifications
You must be signed in to change notification settings - Fork 69
Stress testing
Stress testing is easy thanks to wrk - modern HTTP benchmarking tool!
Stress test configuration is adjustable. There are a few configuration files:
- test sessions - each file contains a test session that can be run using wrk. Test session contains a list of requests to be sent one by one from each thread.
- buying session - represents a sample order process.
- create-reserve-confirm - a test session consisting of 3 commands: CreateReservation, ReserveProduct and ConfirmReservation. Does not require invoicing and shipping subsystems to be running.
Please notice that you don't need to specify value of reservationId
/orderId
/invoiceId
parameter as it will be generated automatically for each new run of the session. Notice also that it is possible to define delay
parameter (in millis) for each request.
-
warmup.sh - you must run it at least once before executing the actual stress test. The script configures ngingx (needed to run the test from wrk) and executes warm-up test using given test session (
buying-session.json
is used by default) and using preconfigured settings (number of threads/connections, max number of sessions or test duration). -
stress.sh - actual stress test that executes given test session (
create-reserve-confirm.json
is used by default). -
wrk-config.lua - stress test logic implemented in lua using wrk framework
You don't need to install and configure wrk
and nginx
by yourself. You can use a docker container built from this Dockerfile.
To start the container execute: start-test-bench.sh
The script will pull newion/wrk
image and run ecommerce-test-bench
container that will start interactive bash session. Now you can run warm-up and stress test from within the container by executing warmup.sh
and stress.sh
scripts located under /mnt/stress-test
respectively. Notice that ${DDD_LEAVEN_AKKA_HOME}/commons/stress-test
folder on host system was mounted as a data volume /mnt/stress-test
in the docker container (thus you can apply changes to test configuration without restarting the test bench (docker container))