k6 executors for each test type

August 02, 2024

It's important to keep in mind that running tests is not cheap. They require a great machine with high network throughput, lots of CPUs for multi-threadeding and 1-5 MB of memory per VU that you can keep at about 80% use. With that in mind you should prioritize which tests are more important for you current situation.

  1. For a Smoke Test the per-vu-iterations executor works best. You can set the number of vus to something like 3 but not more than 5. Only 1 VU is already a smoke test. You can set iterations for 1, making each VU make only one iteration. Set your maxDuration to something like 10s or 15s or depending on the number of requests and average latency. Something similar can be achieved with shared-iterations if you keep the same number of vus and iterations.

  2. The average Load test is the most complex because it depends on how your system is used. You probably should be using one of the open model executors, constant-arrival-rate or ramping-arrival-rate, since your users don't care how many users the system is currently serving, they just want to use your system.

  3. In the Spike test the executor will be ramping-vus with the a high target and low duration for each stage.

  4. In the Breakpoint test we will also be using ramping-vus, but with a high target and long duration so you can clearly see where the system breaks.

  5. In the Soak test, constant-vus with the maximum viable duration.