Reliability and performance tests

Breakpoint test

1 min

Intro

Breakpoint test determines the point at which a system fails under increasing load. The goal is to identify the threshold where performance degrades beyond acceptable levels or the system becomes unavailable.

 
Easy explanation

Checking at what point a bridge starts to crack when adding more cars step by step.

Scheme

Breakpoint test scheme

 
Info

To better understand the terms in testing and tool k6 see vocabulary.

Key characteristics

  • Stepwise load increase: Load gradually ramps up in stages until failure or unacceptable performance.
  • Failure point identification: Focus on discovering the exact load level where degradation begins.
  • Helps define safe limits: Useful for setting realistic performance targets and capacity boundaries.
  • Optional recovery check: Observe how the system behaves after reaching the breakpoint.

Practical examples

  • At what number of concurrent users does the application start timing out?
  • How much load can the database handle before query performance degrades significantly?

Users and time

  • Number of virtual users:

    Load increases gradually in steps until failure (e.g., increments of 50 users every few minutes).

  • Execution time:

    Depends on increments but typically 20–45 min, sufficient to identify the breakpoint precisely.

Example with tool k6

script.js

import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '5m', target: 50 },
    { duration: '5m', target: 100 },
    { duration: '5m', target: 150 },
    { duration: '5m', target: 200 },
    { duration: '5m', target: 250 },
    { duration: '5m', target: 300 },
    { duration: '5m', target: 0 },
  ],
  thresholds: {
    http_req_failed: ['rate<0.01'],
    http_req_duration: ['p(95)<1000'],
  },
};

export default function () {
  const response = http.get('https://api.example.com/products');

  check(response, {
    'status is 200': (res) => res.status === 200,
  });

  sleep(1);
}
Resources