Skip to content

Commit

Permalink
Scenarios, explain VUs distribute over iters non-uniformly (#1016)
Browse files Browse the repository at this point in the history
Closes #136

Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
  • Loading branch information
MattDodsonEnglish and mstoykov authored Jan 31, 2023
1 parent 1471633 commit 7d3ccb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ want to model to test your services.

Possible values for `executor` are the executor name separated by hyphens.

<Blockquote mod="note" title="VUs might not distribute uniformely over iterations">

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.

</Blockquote>



| Name | Value | Description |
| ---------------------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Shared iterations](/using-k6/scenarios/executors/shared-iterations) | `shared-iterations` | A fixed amount of iterations are<br/> "shared" between a number of VUs. |
Expand Down

0 comments on commit 7d3ccb9

Please sign in to comment.