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

enhance worker balancing logic #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mchekh
Copy link

@mchekh mchekh commented Sep 15, 2023

This update introduces a more adaptive approach to task allocation.
In cases where a worker is occupied processing synchronous code, instead of instantly assigning a task to the worker with the best yet ELU, the task will now attempt to find another available worker or wait for the first free worker. Workers captured from the pool on task invocation and will return back as soon as all synchronous code in the first event loop cycle is completed.
In cases when tasks consist of periodic asynchronous and large blocking operations some other tasks can be trapped but one of the next tasks will capture the worker until starts executing, in addition to ELU balancing it gives more smooth distribution and makes allocation more durable to the task fluctuations.

  • Decomposed pool and balancing logic
  • Added worker availability logic
  • Implemented tread wait logic
  • Added balancing customisability

  • tests and linter show no problems (npm t)
  • tests are added/updated for bug fixes and new features
  • code is properly formatted (npm run fmt)
  • description of changes is added in CHANGELOG.md
  • update .d.ts typings

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