Skip to content
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

release-21.1: sql: default to batch size 1 in allocator #62603

Merged
merged 1 commit into from
Mar 26, 2021

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #62534.

/cc @cockroachdb/release


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 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.

Resolves #62524.

Release note: None

@yuzefovich yuzefovich requested review from jordanlewis and a team March 25, 2021 14:32
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: (but looks like you have a failing test)

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis)

@yuzefovich
Copy link
Member Author

Oh yeah, Jordan has a fix for it.

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
@yuzefovich yuzefovich merged commit f602e37 into cockroachdb:release-21.1 Mar 26, 2021
@yuzefovich yuzefovich deleted the backport21.1-62534 branch March 26, 2021 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants