Purpose
Soak tests help you:- Identify memory leaks and resource exhaustion
- Detect gradual performance degradation over time
- Verify database connection pool management
- Test log rotation and disk space management
- Validate that systems remain stable over hours or days
- Find issues that only appear after extended runtime
Soak tests require significant time investment but are crucial for production readiness. They catch issues that shorter tests miss.
Configuration Pattern
Soak tests use moderate load for extended duration:Load Level
80-100% of normal capacity
Duration
Minimum 4-8 hours
Goal
Stable performance throughout
Using the Constant VUs Executor
Theconstant-vus executor maintains steady load:
Using the Ramping VUs Executor
For controlled ramp-up and ramp-down:Soak Test Stages
1
Ramp Up
Gradually increase to target load over 5-10 minutes.
2
Sustained Load
Maintain constant load for extended period (4-24 hours).
3
Ramp Down
Gracefully reduce load and monitor cleanup.
Soak Test Duration Guidelines
Minimum
4 hours - catches most common issues
Recommended
8-12 hours - comprehensive testing
Extended
24-72 hours - production simulation
Weekend
Full weekend - ultimate confidence
Realistic Soak Test Example
Using Constant Arrival Rate
Maintain consistent request rate:What to Monitor
Time-Based Metrics
Track how metrics change over time:Critical Indicators
Memory Usage
Should remain stable, not gradually increase
Response Times
Should not degrade over time
Error Rates
Should remain consistently low
Resource Utilization
CPU, memory, disk should be stable
Best Practices
Choose Appropriate Load
Don’t use maximum capacity for soak tests:Soak tests should use sustainable load levels (80-100% of normal capacity), not maximum stress levels.
Monitor Throughout the Test
Track metrics at regular intervals:Compare First and Last Hours
Key analysis: Does performance degrade?Common Issues Found
Memory Leaks
Resource Exhaustion
Watch for:- Database connection pool exhaustion
- File descriptor limits
- Thread pool saturation
- Disk space depletion from logs
Gradual Performance Degradation
Signs of degradation:- Response times increase over hours
- Throughput decreases over time
- Error rates gradually increase
- Resource utilization grows unbounded
Analysis Tips
Create Time-Series Graphs
Visualize metrics over the full duration:- Response time (p50, p95, p99) over time
- Error rate over time
- Throughput over time
- Active VUs over time
Look for Patterns
1
Hour 1
Baseline performance after initial ramp-up
2
Hours 2-4
Should remain stable and consistent
3
Hours 4-8
Watch for gradual degradation
4
Final Hour
Compare against Hour 1 baseline
Success Criteria
- Performance metrics remain stable throughout
- No memory leaks or resource exhaustion
- Error rates stay consistently low
- System recovers cleanly after test ends
When to Use
- Pre-production: Before major releases
- After infrastructure changes: Validate stability
- Performance regression testing: Compare releases
- Production simulation: Weekend-long tests
- Compliance requirements: Prove reliability