feat: Update concurrency formula. #1907
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.
The Problem
There's a "bug" in the concurrency formula on the scheduler (all strategies).
This is the formula:
But these values are hardcoded:
So if you replace:
This means that any plugin whose default concurrency is
<= 100
will have a table concurrency of1
, even if it's the only table being synced (assuming no one changes the default).The Fix
I made a very subtle change in the formula. Only if concurrency is
<= 100
, I change theminResourceConcurrency
toconcurrency/10
. This decreases the resource concurrency up to 10x (that we don't seem to be hitting anyway), and increases the table concurrency up to 10x.Plugins affected (on default concurrency)
clickhouse(doesn't use scheduler)file(doesn't use scheduler)s3(doesn't use scheduler)The Results
I'm still working on the results (it's trickier than it seems).
In principle, they are very encouraging:
BigQuery
Before
After
Result
1.43x of regular speed (43% faster)
Sentinelone
Before
After
Result
4.27x of regular speed (327% faster)
Sonarqube
Before
After
Result
1.77x of regular speed (77% faster)