Load Profile Configuration

Learn how to configure load profiles to simulate different traffic patterns and test your APIs under various load conditions.

What is a Load Profile?

A load profile defines how virtual users and requests are distributed over time during a performance test. It determines the pattern of load application, which is crucial for realistic performance testing.

Common Load Patterns

Ramp-Up (Gradual Increase)

Gradually increases the number of virtual users over time until reaching the target load. This simulates a gradual increase in traffic.

Start: 0 VUs
Ramp-up: 5 minutes
Target: 100 VUs
Duration: 10 minutes

Use Case: Normal traffic growth, realistic user behavior

Constant Load

Maintains a constant number of virtual users throughout the test duration. This tests steady-state performance.

Virtual Users: 50
Duration: 15 minutes
No ramp-up

Use Case: Baseline testing, steady-state validation

Spike Testing

Suddenly increases load to a high level, then returns to normal. This tests how your API handles sudden traffic spikes.

Baseline: 20 VUs (5 minutes)
Spike: 200 VUs (2 minutes)
Return: 20 VUs (5 minutes)

Use Case: Flash sales, viral content, breaking news

Soak Testing

Maintains load for an extended period (hours). This identifies memory leaks and long-term stability issues.

Virtual Users: 50
Duration: 4 hours
Ramp-up: 10 minutes

Use Case: Memory leak detection, long-term stability

Step Load

Increases load in steps, holding each level for a period before increasing again. This helps identify performance degradation points.

Step 1: 25 VUs (5 min)
Step 2: 50 VUs (5 min)
Step 3: 100 VUs (5 min)
Step 4: 150 VUs (5 min)

Use Case: Finding breaking points, capacity planning

Configuring Ramp-Up

Ramp-up is the period during which virtual users gradually increase from zero to the target number. Proper ramp-up configuration is important for realistic testing.

Ramp-Up Considerations

  • Gradual Ramp-Up: Allows system to warm up gradually (recommended for most tests)
  • Quick Ramp-Up: Faster ramp-up for stress testing
  • No Ramp-Up: Immediate full load (use with caution, can overwhelm system)
  • Custom Ramp-Up: Define custom ramp-up curves for specific scenarios
Example Ramp-Up Configuration:
Target VUs: 100
Ramp-up Time: 5 minutes
Result: ~20 VUs added per minute

Request Distribution

Configure how requests are distributed among different endpoints and virtual users.

Distribution Options

  • Equal Distribution: Each endpoint receives equal load
  • Weighted Distribution: Assign weights to endpoints based on expected traffic
  • Sequential: Execute requests in a specific order
  • Random: Randomly select endpoints for each virtual user

Think Time and Pacing

Think time simulates the delay between requests that real users would have, making tests more realistic.

Think Time Configuration

  • Fixed Think Time: Constant delay between requests (e.g., 2 seconds)
  • Random Think Time: Random delay within a range (e.g., 1-5 seconds)
  • No Think Time: Maximum throughput testing (requests as fast as possible)
  • Pacing: Control the rate at which requests are made

Best Practices

  • Match Real Traffic: Configure load profiles to match real-world traffic patterns
  • Start with Ramp-Up: Use gradual ramp-up for most tests to avoid overwhelming the system
  • Test Different Patterns: Test various load patterns to understand system behavior
  • Consider Business Hours: Model traffic patterns based on actual usage patterns
  • Use Think Time: Add realistic think time for more accurate results
  • Document Patterns: Document which load patterns you've tested and why
  • Iterate: Adjust load profiles based on test results and requirements

Next Steps