From 7d3ccb9c79b091f655c51e1ceca9aaf820313506 Mon Sep 17 00:00:00 2001 From: Matt Dodson <47385188+MattDodsonEnglish@users.noreply.github.com> Date: Tue, 31 Jan 2023 11:06:38 -0300 Subject: [PATCH] Scenarios, explain VUs distribute over iters non-uniformly (#1016) Closes #136 Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com> --- .../00 Concepts/02 Arrival-rate VU allocation.md | 6 ++++++ .../en/02 Using k6/14 Scenarios/01 Executors.md | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/00 Concepts/02 Arrival-rate VU allocation.md b/src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/00 Concepts/02 Arrival-rate VU allocation.md index ca5b4f2c1..964a70cdd 100644 --- a/src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/00 Concepts/02 Arrival-rate VU allocation.md +++ b/src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/00 Concepts/02 Arrival-rate VU allocation.md @@ -112,3 +112,9 @@ Some of the times it might make sense to use `maxVUs` include: - To determine necessary allocation in first-time tests - To add a little "cushion" to the pre-allocated VUs that you expect the test needs - In huge, highly distributed tests, in which you need to carefully scale load generators as you increment VUs. + +## You can't guarantee which VU runs an iteration + +As with all executors, you can't predict the specific VU that an arrival-rate executor uses for a specific iteration. +As the test runs on, the executor might use some or all of the allocated VUs, even if it never needs the entire allocated number to reach the iteration rate. + diff --git a/src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/01 Executors.md b/src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/01 Executors.md index 88c7f0f6f..3da8b53b9 100644 --- a/src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/01 Executors.md +++ b/src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/01 Executors.md @@ -9,6 +9,19 @@ want to model to test your services. Possible values for `executor` are the executor name separated by hyphens. +
+ +For any given scenario, you can't guarantee that a specific VU can run a specific iteration. + +With [`SharedArray`](/javascript-api/k6-data/sharedarray/) and [execution context variables](/using-k6/execution-context-variables/), you can map a specific VU to a specific value in your test data. +So the tenth VU could use the tenth item in your array (or the sixth iteration to the sixth item). + +But, you _cannot_ reliably map, for example, the tenth VU to the tenth iteration. + ++ + + | Name | Value | Description | | ---------------------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | [Shared iterations](/using-k6/scenarios/executors/shared-iterations) | `shared-iterations` | A fixed amount of iterations are