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

allow configurable range of priorities >100 #15516

Closed
tgross opened this issue Dec 9, 2022 · 5 comments
Closed

allow configurable range of priorities >100 #15516

tgross opened this issue Dec 9, 2022 · 5 comments
Labels
good first issue hcc/cst Admin - internal help-wanted We encourage community PRs for these issues! theme/scheduling type/enhancement
Milestone

Comments

@tgross
Copy link
Member

tgross commented Dec 9, 2022

Users who want fine-grained control over job priorities combined with a large volume of jobs being submitted at once (ex. large batch workloads) have reported that having only 100 levels of priority isn't fine-grained enough. The range from 0 to 100 is arbitrary and hard-coded as a integer literal in all the various places it's used.

We can instead turn this constant into a server configuration value with a default of 100 (the default eval/job priority can be left at 50, or we could make that a configuration value as well). Because priority 0 is the lowest-priority in Nomad, this can be done without impacting backwards compatibility. It'd just be up for operators to set sensible values when they restart servers with new values.

cc @sofixa

@tgross tgross added type/enhancement theme/scheduling hcc/cst Admin - internal good first issue help-wanted We encourage community PRs for these issues! labels Dec 9, 2022
@alessio-perugini
Copy link
Contributor

alessio-perugini commented Feb 7, 2023

👋 @tgross If you don't mind, I'd like to take care of this. 🤓
I was thinking about some open points:

  1. What would be the minimum and maximum values of JobDefaultPriority and JobMaxPriority?
    Do we want to keep the current default values as a lower bound and allow only to go upper? Or we're okay to go below our default current values? (0-100)
  2. Should we also change the default value of CoreJobPriority = JobMaxPriority * 2 to avoid possible int overflow?

For the second point, I can see two options:

  • CoreJobPriority = math.MaxInt
  • CoreJobPriority = JobMaxPriority+1

@tgross
Copy link
Member Author

tgross commented Feb 7, 2023

What would be the minimum and maximum values of JobDefaultPriority and JobMaxPriority?

The goal here is to give cluster admins greater range, so the minimum value should be the current hard-coded value. JobDefaultPriority = 50 and JobMaxPriority = 100.

It's a good catch to note that CoreJobPriority is set to the max * 2. We need to ensure that CoreJobPriority is always greater than any user-defined value. Off the top of my head I don't see any issues with setting CoreJobPriority so high as to where it'd cause overflow. But maybe out of an abundance of caution we cap priority to math.MaxInt16 during validation without changing the field value from int (which we need to keep for backwards compatibility of serialized values). That'll give us headroom for new features if we need it, too.

So we that would give us the following:

  • CoreJobPriority is hard-coded to math.MaxInt16 (32767)
  • JobMaxPriority defaults to 100 and can be configured in the range 100 <= JobMaxPriority < math.MaxInt16.
  • JobDefaultPriority defaults to 50 and can be configured in the range 50 <= JobDefaultPriority < JobMaxPriority

Thanks @alessio-perugini! Looking forward to your PR!

@alessio-perugini
Copy link
Contributor

@tgross I've created a quick draft to understand if I'm on the right path. #16084

@tgross
Copy link
Member Author

tgross commented Feb 17, 2023

Closed by #16084

@tgross tgross closed this as completed Feb 17, 2023
@tgross tgross added this to the 1.5.0 milestone Feb 17, 2023
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue hcc/cst Admin - internal help-wanted We encourage community PRs for these issues! theme/scheduling type/enhancement
Projects
None yet
Development

No branches or pull requests

2 participants