What is performance testing, and what are load, stress and soak tests?

BeginnerConceptTesting in DevOps
Answer

In one line: Performance testing checks how fast and stable a system is under different amounts of traffic; load, stress, spike and soak tests are different types, each answering a different question.

The main types:

  1. Load test — "Can we handle the traffic we expect?" Run the expected peak (for example 2,000 requests per second) and check response times and error rates.
  2. Stress test — "Where does it break, and how?" Increase traffic beyond normal until the system fails, to find the limit and see if it fails gracefully.
  3. Spike test — "What happens with a sudden jump?" Go from 100 to 5,000 users in seconds, like a flash sale or a viral post. Does autoscaling react in time?
  4. Soak (endurance) test — "Does it stay healthy over time?" Run normal load for hours to find memory leaks, connection pool exhaustion or disks filling up.

What to measure:

  • Response time — especially percentiles (p95, p99), not just the average.
  • Throughput (requests per second).
  • Error rate.
  • Resource usage: CPU, memory, database connections, queue length.

Tools: k6, JMeter, Gatling, Locust, Artillery; cloud services like Azure Load Testing.

Example k6 test:

import http from 'k6/http';
export const options = {
  vus: 200, duration: '10m',
  thresholds: { http_req_duration: ['p(95)<500'], http_req_failed: ['rate<0.01'] },
};
export default function () { http.get('https://staging.example.com/api/products'); }

The thresholds make the test fail the pipeline if p95 latency goes above 500 ms or errors exceed 1%.

In DevOps: run a short load test in the staging pipeline for key services, and bigger tests before major events. Test in an environment sized like production, or results can mislead.

Tip for interviews: mention percentiles (p95/p99) and thresholds that fail the pipeline.

All DevOps Fundamentals questions

More on Testing in DevOps