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

WIP: Update dispatchQuery to use min_cores #788

Conversation

DiegoTavares
Copy link
Collaborator

@DiegoTavares DiegoTavares commented Sep 30, 2020

Sorting jobs only by priority causes a situation where low priority jobs can get starved by a constant flow of high priority jobs.
The new formula adds a modifier to the sorting rank to take into account the number of cores the job is requesting and also the number of days the job is waiting on the queue.
Priorities numbers over 200 will mostly override the formula and work as a priority only based scheduling.
sort = priority + (100 * (1 - (job.cores/job.int_min_cores))) + (age in days)

Besides that, also take layer_int_cores_min into account when filtering folder_resourse limitations to avoid allocating more cores than the folder limits.

Sorting jobs only by priority causes a situation where low priority jobs can get starved by a constant flow of high priority jobs.
The new formula adds a modifier to the sorting rank to take into account the number of cores the job is requesting and also the number of days the job is waiting on the queue.
Priorities numbers over 200 will mostly override the formula and work as a priority only based scheduling.
sort = priority + (100 * (1 - (job.cores/job.int_min_cores))) + (age in days)

Besides that, also take layer_int_cores_min into account when filtering folder_resourse limitations to avoid allocating more cores than the folder limits.

(cherry picked from commit 566411aeeddc60983a30eabe121fd03263d05525)
@DiegoTavares
Copy link
Collaborator Author

As described in the commit text, the new formula will not effectively affect priority numbers above 200. We'll need to document this somewhere.

Copy link
Collaborator

@bcipriano bcipriano left a comment

Choose a reason for hiding this comment

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

Code changes LGTM, but a scheduler change like this that doesn't require any tests to change is concerning.

Do we need changes to DispatcherDaoTests to test any of this new logic?

"FROM ( " +
"SELECT " +
"job.pk_job as pk_job, " +
"/* sort = priority + (100 * (1 - (job.cores/job.int_min_cores))) + (age in days) */ " +
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this line be removed? Or maybe, if it's meant to explain the following code, make it a bit more clear that it's a comment.

@DiegoTavares DiegoTavares changed the title Update dispatchQuery to use min_cores WIP: Update dispatchQuery to use min_cores Oct 14, 2020
@DiegoTavares
Copy link
Collaborator Author

Changing this to WIP as we're developing a variation of this to handle some edge cases

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