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

When queuing multiple jobs at once, nudge more than one worker #389

Merged
merged 6 commits into from
Nov 13, 2023

Conversation

benjie
Copy link
Member

@benjie benjie commented Nov 13, 2023

Description

Previously if you called add_jobs() and passed in 100 jobs, the jobs:insert announcement would only be made once, resulting in only one idle worker being triggered. i.e. the first of these 100 jobs would start straight away, but the rest would only start once the other workers' poll interval ticked.

Now we add the count of the number of jobs queued to the announcement, and we keep nudging workers to look at the job until either there are no more available workers or we've nudged at least this many workers.

Performance impact

There was a performance cost on the queuing side (according to my benchmarks, queuing time could increase by up to 5%) so I've overhauled how queueing works to remove a trigger call and thus the net change is close to zero.

Security impact

None known.

Checklist

  • My code matches the project's code style and yarn lint:fix passes.
  • I've added tests for the new feature, and yarn test passes.
  • I have detailed the new feature in the relevant documentation.
  • I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • If this is a breaking change I've explained why.

@benjie benjie merged commit 8ed836c into main Nov 13, 2023
14 checks passed
@benjie benjie deleted the nudge-more branch November 13, 2023 16:19
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.

1 participant