-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: default to batch size 1 in allocator #62534
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Mar 24, 2021
In cockroachdb#62282, the estimated row count was passed into the scan batch allocator to avoid growing the batch from 1. However, this also changed the default batch size from 1 to 1024 when no row count estimate was available, giving significant overhead when fetching small result sets. On `kv95/enc=false/nodes=1/cpu=32` this reduced performance from 66304 ops/s to 58862 ops/s (median of 5 runs), since these are single-row reads without estimates. This patch reverts the default batch size to 1 when no row count estimate is available. This fully fixes the `kv95` performance regression. YCSB/E takes a small hit going from 1895 ops/s to 1786 ops/s, but this only seems to happen because it takes a while for the statistics to update: sometime within the first minute of the test (after the 1-minute ramp-up period), throughput abruptly changes from ~700 ops/s to ~1800 ops/s, so using a 2-minute ramp-up period in roachtest would mostly eliminate any difference. Release note: None
erikgrinaker
force-pushed
the
colfetcher-batch-size
branch
from
March 24, 2021 16:16
7c6e67d
to
aa74f4d
Compare
erikgrinaker
changed the title
sql: default to scan batch size 1 without row count estimate
sql: default to batch size 1 in allocator
Mar 24, 2021
erikgrinaker
added a commit
to erikgrinaker/cockroach
that referenced
this pull request
Mar 24, 2021
In cockroachdb#62534 it was shown that it takes up to two minutes before we have good enough statistics to allocate appropriately sized batches. However, the YCSB workloads only had a 1-minute ramp time, which would skew the results as throughput would abruptly change when the statistics were updated during the test. This patch changes the ramp time for YCSB workloads to 2 minutes to make sure we have appropriate statistics before starting the actual test. Release note: None
yuzefovich
approved these changes
Mar 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis)
bors r=yuzefovich |
Build failed (retrying...): |
Build failed (retrying...): |
Build succeeded: |
erikgrinaker
added a commit
to erikgrinaker/cockroach
that referenced
this pull request
Mar 25, 2021
In cockroachdb#62534 it was shown that it takes up to two minutes before we have good enough statistics to allocate appropriately sized batches. However, the YCSB workloads only had a 1-minute ramp time, which would skew the results as throughput would abruptly change when the statistics were updated during the test. This patch changes the ramp time for YCSB workloads to 2 minutes to make sure we have appropriate statistics before starting the actual test. Release note: None
This was referenced Mar 25, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In #62282, the estimated row count was passed into the scan batch
allocator to avoid growing the batch from 1. However, this also changed
the default batch size from 1 to 1024 when no row count estimate was
available, giving significant overhead when fetching small result sets.
On
kv95/enc=false/nodes=1/cpu=32
this reduced performance from 66304ops/s to 58862 ops/s (median of 5 runs), since these are single-row
reads without estimates.
This patch reverts the default batch size to 1 when no row count
estimate is available. This fully fixes the
kv95
performanceregression. YCSB/E takes a small hit going from 1895 ops/s to 1786
ops/s, but this only seems to happen because it takes a while for the
statistics to update: sometime within the first minute of the test
(after the 1-minute ramp-up period), throughput abruptly changes from
~700 ops/s to ~1800 ops/s, so using a 2-minute ramp-up period in
roachtest would mostly eliminate any difference.
Resolves #62524.
Release note: None