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

Throttle tasks based on presence of a scheduler #1109

Conversation

danielmitterdorfer
Copy link
Member

Previously Rally has considered a task only throttled if it specified a
target throughput. This assumes that there is a meaningful target
throughput to specify though. Consider a more complex case where we want
to simulate a traffic pattern that changes over the course of a
(simulated) day. In that case there is no single "right" target
throughput that can be specified.

With this commit we consider tasks also throttled if no target
throughput is specified but the user has supplied a scheduler
explicitly. We assume that the scheduler will use different parameters
specified on the task to determine its behavior.

Previously Rally has considered a task only throttled if it specified a
target throughput. This assumes that there is a meaningful target
throughput to specify though. Consider a more complex case where we want
to simulate a traffic pattern that changes over the course of a
(simulated) day. In that case there is no single "right" target
throughput that can be specified.

With this commit we consider tasks also throttled if no target
throughput is specified but the user has supplied a scheduler
explicitly. We assume that the scheduler will use different parameters
specified on the task to determine its behavior.
@danielmitterdorfer danielmitterdorfer added enhancement Improves the status quo :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc. labels Nov 4, 2020
@danielmitterdorfer danielmitterdorfer added this to the 2.0.3 milestone Nov 4, 2020
@danielmitterdorfer danielmitterdorfer self-assigned this Nov 4, 2020
@gingerwizard
Copy link

gingerwizard commented Nov 4, 2020

I believe we're going to have other issues here. In the UnitAwareScheduler we delegate to the underlying scheduler but don't consider which API is being used - specifically line 288

self.scheduler = self.scheduler_class(self.task, target_throughput)

Where as https://github.com/elastic/rally/pull/1109/files#diff-06ef37921d5086a4d08c6751e12eca6478037b37e832e2e7972d23ba1b3468ceL107 we only pass one parameter. We define the advanced interface as needing just the task.

@danielmitterdorfer
Copy link
Member Author

danielmitterdorfer commented Nov 5, 2020

In the UnitAwareScheduler we delegate to the underlying scheduler but don't consider which API is being used

It is a precondition of the UnitAwareScheduler that only "simple" scheduler classes are passed in its constructor and this is checked in:

elif is_simple_scheduler(scheduler_class):
logger.debug("Treating [%s] for [%s] as a simple scheduler.", scheduler_class, task)
return UnitAwareScheduler(task, scheduler_class)

Copy link

@gingerwizard gingerwizard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielmitterdorfer some test failures here. Change in principle makes sense once the int tests are fixed.

@danielmitterdorfer
Copy link
Member Author

@danielmitterdorfer some test failures here. Change in principle makes sense once the int tests are fixed.

The test failure has been caused by a misclassification of the UtilizationScheduler class. Previously a scheduler was classified as "legacy scheduler" iff it had exactly two constructor parameters (self and params) and one of them was called params. However, the constructor signature of UtilizationScheduler is:

def __init__(self, params, perf_counter=time.perf_counter):

The additional parameter is needed for unit tests but prevented classification as a legacy scheduler. I have loosened the check now in 9b72a3c and fixed a follow-up issue uncovered by the tests in c8c70b2. IMHO it's ok to be a bit lenient here because we should remove support for legacy schedulers (along with this check) with Rally 2.1.0.

Copy link

@gingerwizard gingerwizard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danielmitterdorfer danielmitterdorfer merged commit 93b7eee into elastic:master Nov 9, 2020
@danielmitterdorfer danielmitterdorfer deleted the throttle-based-on-scheduler branch November 9, 2020 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the status quo :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants