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

Scheduler: make demand cap a share not a cost #3891

Closed
wants to merge 2 commits into from

Conversation

robertdavidsmith
Copy link
Collaborator

@robertdavidsmith robertdavidsmith commented Aug 23, 2024

Problem

There is currently a problem when adjustedFairShare is capped by demand.

The scheduler caps adjustedFairShare to cost at https://git.c3.zone/GR/armada/blob/69232402e78d1a420d56374415436fe15d2ebf0e/internal/scheduler/context/scheduling.go#L174

However, when deciding whether to evict a job, it compares fair share to actualShare = cost / totalCost at

actualShare := sch.schedulingContext.FairnessCostProvider.UnweightedCostFromQueue(qctx) / totalCost

If totalCost < 1 (which it often is in practice), dividing by totalCost inflates actualShare so that it thinks actualShare is above fair share even for fairly undemanding users. So it evicts many jobs well below fair share.

Solution

Divide cappedShare by totalCost so the adjustedFairShare demand cap is consistent with the eviction logic.

Signed-off-by: robersmi606 <robert.smith@gresearch.co.uk>
Signed-off-by: robersmi606 <robert.smith@gresearch.co.uk>
@robertdavidsmith robertdavidsmith deleted the sendToGitHub/sched-demand-fix branch September 4, 2024 13:10
@svc-gh-ghzonetrans-p svc-gh-ghzonetrans-p restored the sendToGitHub/sched-demand-fix branch September 4, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants