Stress Test Introduction
Stress Test
A stress test is a process designed to discover or verify the limits of a target system.
Examples of target systems include:
- a particular feature
- a single service running in containers or physical machines
- a complex platform comprising of multiple servers and services
- etc.
Stress Source Container
A stress source is any entity capable of inducing load on the target system(s) by repeatedly performing stress actions.
Examples of stress actions are:
- repeatedly sending a particular query to a target
- repeatedly completing a checkout process
- repeatedly playing back a set of recorded traffic to a target
A human being can be a stress source, but that task is usually more appropriately done by a machine.
It is a container that repeatedly performs the stress action(s) once it is started.
Units of stress
A stress source container can send an arbitrary amount of stress traffic.
For instance, it may be able to create 50 checkouts a second.
If we need 10 times the amount of stress, we simply scale the stress source container to 10 instances.
Stress Test Orchestration
Definition
A stress orchestrator is any entity that controls the process of a stress test.
Using stress source containers, a human being can be a stress orchestrator using the following process:
- Prepare for stress test (scale resources, make announcements, etc.)
- Start stress source containers
- Repeat until success or failure: Check monitoring dashboards (QPS, errors, utilization, etc.)
- If errors, scale down or stop stress source containers
- If target not reached, scale up stress source containers
- Revert everything back to normal
This is a simple concept, but every step is tedious, time-consuming and prone to human-errors.
Orchestration Worker
An orchestration worker replaces the need for a human in this process (other than for starting it).
An orchestration worker implements a form of control system to steer the stress test towards its goal.
PID Controller
A proportional-integral-derivative controller, otherwise known as a PID controller, is negative feedback control system.
PID controllers are typically used in:
- car cruise controls for regulating speeds
- automated doors for regulating door positions
- unmanned aerial vehicles for regulating altitude and attitude
- etc.
A PID controller usually has a target, known as a setpoint, and a means of obtaining the current value known as the process variable.
The error value is the difference between the setpoint and the process variable.
A manipulated variable is the output of the PID controller, which is obtained by calculating the error value against the proportional gain, integral gain and derivative gain.
You can read more about PID Controllers in Wikipedia.
Each orchestration worker starts with a abstract OrchestrationWorker class, and is implemented with the actual strategy to create the different orchestrators:
When implementing the OrchestrationWorker class, only the Applying Strategy state needs to be implemented (that is where the calculations take place).