Reliability and performance tests
Runnable example of load test
1 min
Script and how to run
The following script, executed with tool k6 , simulates a basic load test:
import http from 'k6/http';
import { sleep } from 'k6';
export const options = {
stages: [
{ duration: '20s', target: 50 },
{ duration: '3m', target: 50 },
{ duration: '20s', target: 0 },
],
thresholds: {
http_req_failed: ['rate<0.01'],
http_req_duration: ['p(95)<1000'],
},
};
export default function () {
const url = 'https://quickpizza.grafana.com';
http.get(`${url}/contacts.php`);
sleep(1);
http.get(`${url}/news.php`);
sleep(1);
}
Install tool k6 and download script.js , then run it locally with:
k6 run script.js
Analysis
After being run k6 produces result .
Info
To better understand the terms in testing and tool k6 see vocabulary.
Test summary
Script simulated traffic to https://quickpizza.grafana.com:
- contacts.php
- news.php
Load pattern:
- Ramp-up: 0 to 50 VUs in 20s
- Sustained: 50 VUs for 3m
- Ramp-down: 50 to 0 VUs in 20s
Total duration: ~3m41,8s. 4452 iterations completed, ~20 iterations/sec.
Observed behavior
- Application responded consistently under load.
- No HTTP request failures observed (0,00% failure rate).
- 95% of requests completed within 152,3ms (well below 1s threshold).
Metrics highlights
- Response time:
Avg: 132,93ms, p(90): 135,1ms, p(95): 152,3ms, Max: 3,98s - Request rate:
39,96 requests/sec overall - Iterations:
4432 iterations (avg iteration ~2,27s)
Data transferred
- Received: 13 MB (~59 kB/s)
- Sent: 1,4 MB (~6,3 kB/s)
Overall analysis
Thresholds met:
- p(95)<1000ms: 152,3ms
- HTTP failures <1%: 0%
Performance stable under 50 concurrent users.
Suggestions and takeaways
Good performance baseline — the service is performant under moderate load.
Next steps:
- Test higher loads (e.g., 100+ VUs) for scalability limits.
- Add checks/assertions to validate content correctness.
- Monitor backend resource utilization (CPU, memory) alongside k6 metrics.