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 bookingqueue #949

Conversation

DiegoTavares
Copy link
Collaborator

This PR implements a simple optimization to declutter the booking queue from repeated entries.

Context: When cuebot is under pressure due a high amount of jobs on the the queue and a high amount of HostReports being submitted, the BookingQueue threadpool might receive repeated tasks, from which only one will actually be executed successfully.

This change uses a cache to make sure no repeated tasks are submitted to the threadpool.

This is running on production in the spi environment for over 3 months.

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)
It was observed that the booking performance is degrating over time. Around 4 tasks are submitted for each booking executed. This solution avoid creating more tasks if there's already a task waiting to be executed.

(cherry picked from commit 57ef9ab989c4d82585b31c95d93b969f6e95e4cd)
@DiegoTavares DiegoTavares merged commit f833ed6 into AcademySoftwareFoundation:master Apr 6, 2021
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.

None yet

3 participants