Types of load tests

test-types

Load test types explained by k6.

Smoke tests

Verify that your system can handle minimal load, without any problems.

Like 1 rps for 1 minute.

Load tests

Assess system performance in terms of concurrent users or requests per second.

If you want to make sure that you can handle 500 rps, you can gradually increase traffic from 0 to 500 rps in 5 minutes, and keep it this way for 10 minutes, for instance. You can do several steps in between. Like 200 rps in 2 minutes, keep for 5 minutes, 400, keep for another 5 minutes, 500, keep for 10 minutes.

Stress and Spike tests

Assess the limits and stability of your system under extreme conditions.

Stress tests

If your service handles 500 rps, you can test it like this

        { duration: "2m", target: 200 }, // below normal load
        { duration: "5m", target: 200 },
        { duration: "2m", target: 400 }, // normal load
        { duration: "5m", target: 400 },
        { duration: "2m", target: 500 }, // around the breaking point
        { duration: "5m", target: 500 },
        { duration: "2m", target: 700 }, // beyond the breaking point
        { duration: "5m", target: 700 },
        { duration: "10m", target: 0 }, // scale down. Recovery stage.

Spike tests

Extreme traffic for an extremely short time.
If your service handles 500 rps, you can test it like this

        { duration: "2m", target: 300 }, // below normal load
        { duration: "5m", target: 300 },
        { duration: "10s", target: 2000 }, // spike way more than service can handle
        { duration: "3m", target: 2000 },
        { duration: "10s", target: 300 }, // scale down. Recovery stage.
        { duration: "3m", target: 300 },
        { duration: "10s", target: 0 },

Soak tests

Assess the reliability and performance of your system over an extended period of time.

If your limit is 500 rps, you can run 400 rps for several hours.

    { duration: '2m', target: 400 }, // ramp up to 400 users
    { duration: '4h', target: 400 }, // stay at 400 for 4 hours

LEAVE A COMMENT