4 ms·
Though it obviously depends on the case at hand, I sort of agree with this. For a distributed build cluster that I maintain (Buildbarn, https://github.com/buil
by EdSchouten 4y ago
Though it obviously depends on the case at hand, I sort of agree with this.
For a distributed build cluster that I maintain (Buildbarn, https://github.com/buildbarn/bb-remote-execution/ https://github.com/buildbarn/bb-remote-execution/), I also had to implement a scheduler process that would queue compilation/test actions, so that they can be executed on workers later on.
Initially I looked into using some conventional queueing system, but eventually settled on implementing my own as part of the scheduler process. So far I'm really happy with this choice, as it has allowed me to implement the following features, and more:
- In-flight deduplication of identical compilation actions. If identical actions are scheduled with different priorities, the highest priority is used.
- Multi-level scheduling fairness between groups, users in a group, builds run by the same user, etc.. The fairness cooperates well with priorities.
- Automatic removal of queued actions that are no longer associated with any running build. When the action was in-flight deduplicated, the priority may need to be lowered again.
- Stickiness, where workers prefer picking up actions that are similar to the one they ran previously, for reducing network utilisation.
- Facilities for draining workers.
Though I'm not saying it would have been impossible to achieve this with an off the shelf task queue, I'm not convinced it would have been easy. Adding new features right now only means I need to care about the actual semantics of it, as opposed to trying to figure out how to map it onto the feature set of the queueing system of choice.
- xyzzy_plugh 4y agoI continue to prefer building a custom queue for anything requiring any features like the ones you describe. I've tried using off-the-shelf queuing systems, and having the full state of a task being spread across systems (or in other words, having to consult multiple systems to decide if work should be done) produces such a complex, buggy mess. Like anything else, when you need to pierce the abstraction, then it no longer serves you in its current form.