Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize the ramping-arrival-rate executor #1944

Closed
na-- opened this issue Apr 2, 2021 · 0 comments · Fixed by #1957
Closed

Optimize the ramping-arrival-rate executor #1944

na-- opened this issue Apr 2, 2021 · 0 comments · Fixed by #1957
Labels
evaluation needed proposal needs to be validated or tested before fully implementing it in k6 performance refactor
Milestone

Comments

@na--
Copy link
Member

na-- commented Apr 2, 2021

Currently, the ramping-arrival-rate executor spawns a new goroutine for every iteration it has to make: https://github.com/k6io/k6/blob/abce5d835c294c77e4a1a880d73171bf6be62d96/lib/executor/ramping_arrival_rate.go#L445

This is in contrast to most of our other executors, which usually spin up a single goroutine per VU and execute iterations inside of it, for example shared-iterations: https://github.com/k6io/k6/blob/abce5d835c294c77e4a1a880d73171bf6be62d96/lib/executor/shared_iterations.go#L274

We have noticed some performance issues with the ramping-arrival-rate executor and we think this excessive goroutine spawning is a big part of the problem: #1386 (comment)

So, we'd like to have a benchmark for the ramping-arrival-rate executor, measuring how it currently behaves with different combinations of preAllocatedVUs and rate options, and also want to to rewrite the executor to spawn just a single goroutine per VU and see if that makes a substantial performance difference.

@na-- na-- added performance refactor evaluation needed proposal needs to be validated or tested before fully implementing it in k6 labels Apr 2, 2021
@na-- na-- added this to the v0.32.0 milestone Apr 2, 2021
@na-- na-- modified the milestones: v0.32.0, v0.33.0 Apr 14, 2021
mstoykov added a commit that referenced this issue May 21, 2021
…ion (#1957)

Create a dedicated goroutine to process iterations
when a new ActiveVU is created for the Ramping arrival rate.

It changes the previous behaviour where instead
a new goroutine was created for every new iteration.

The previous solution was impacting the expected rate (iterations/s)
using a number of PreAllocatedVUs around thousand.
Added a Benchmark to check the rate with a set of PreAllocatedVUs cases.

Closes #1944

Co-authored-by: Mihail Stoykov <MStoykov@users.noreply.github.com>
Co-authored-by: Ivan Mirić <ivan@imiric.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluation needed proposal needs to be validated or tested before fully implementing it in k6 performance refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant