BICAWS7-3351: Add concurrency limits to workflows #1315
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.
This commit adds concurrency limits to the first job of each workflow to limit the number of concurrent workflows to 40.
By adding a
concurrencyExecLimit
to the first task of each workflow, we can control how many of those workflows run at a given time. Because phases 1, 2 & 3 share the same first task (lock_s3_file
), applying a concurrency limit to that task means we can control the total number of those three workflows running simultaneously.Without concurrency limit (2000 messages):
Commit latency starts lower, but spikes when messages start clearing phase 1, and the compare files workflows begin.
The time to process messages was about 16.9 minutes.
With concurrency limit (2000 messages):
Commit latency more evenly spread, with a lower maximum.
The time to process messages was about 18.5 minutes.
Adding a concurrency limit reduces database commit latency at the cost of an extra two minutes to process the incoming message queue.
Note
It's not as easy to limit the
compare_files
workflow, as the first task is a native conductor one, so there is no correspondingtask.json
to add aconcurrencyExecLimit
. As we can only limit the second task, this would probably explain why the throttled data still shows a spike in commit latency. This problem will solve itself as we reduce the need to compare outputs from old/new Bichard