cylc task-message: unified message queue #1809
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Each task currently has its own individual message queue, which contains a relatively expensive
Queue.Queue
object. As we get more and more tasks in a suite, this becomes increasingly unwieldy to keep in memory and to keep checking for new messages.This change rolls the queues up into a single task pool message queue. It saves around 20% of the per-task memory for the minimal tasks I've tested, which is around 10% of the total memory usage - a surprising amount. The CPU usage is reduced by a couple of percent for a 'super-busy' suite, largely just due to not calling
qsize
as much.Due to the communication change, this will break daemon-task mismatched versions before and after this PR, so I've initially put this in the
soon
milestone.I've also added a proper profiling behaviour on running with the
--profile
switch - it is kind of a pain to keep git stashing and stash applying this bit of code!@hjoliver, @matthewrmshin please review.