Cheat sheets / Performance testing and JMeter
Performance testing and JMeter
Load test types, the metrics to quote, and a JMeter refresher.
Test types
- Load
- Expected traffic, to confirm targets are met.
- Stress
- Beyond expected traffic, to find the breaking point and how it fails.
- Spike
- A sudden jump, to see how the system and autoscaling cope.
- Soak
- Steady load for hours to expose leaks and slow degradation.
Metrics to quote
- Percentiles
- p95 and p99 latency say more than the average.
- Throughput
- Requests per second the system sustains.
- Error rate
- Percentage of failed requests under load.
- Resource use
- CPU, memory, connections and queue depth on the servers.
JMeter
- Thread group
- Number of users, ramp-up time and loop count.
- Sampler and assertions
- A request, plus checks on status and content.
- Correlation
- Extract a dynamic value (token, id) from one response with a post-processor and reuse it as a variable.
- Run it headless
- GUI is for building; run from the command line in CI.
jmeter -n -t plan.jmx -l results.jtl