changefeedccl: Make kvevent.Event memory efficient#87718
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Sep 9, 2022
Merged
changefeedccl: Make kvevent.Event memory efficient#87718craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
Contributor
Author
|
This change has been validated on a 15 node cluster, running TPC-E workload. Prior to this change, starting the changefeed resulted With this change, SQL throughput briefly drops from 22k to 12k, but then recovers to 21K; while the latency, |
Contributor
Author
|
@nvanbenschoten : FYI |
ajwerner
approved these changes
Sep 9, 2022
Contributor
ajwerner
left a comment
There was a problem hiding this comment.
LGTM this is definitely better
c3bf6a3 to
c2403b9
Compare
Fixes cockroachdb#84709 `kvevent.Event` structure is very inefficient in its use of pointers. The number of pointers in the structure makes go GC processes more expensive, resulting in loss of performance in the cluster. This is particularly clear during the initial scan, when changefeeds rapidly allocate large number of events, which are then (rapidly) releases -- putting pressure on the go runtime GC. This PR replaces the use of multiple pointers with a single `*roachpb.RangeFeedEvent`. The direct use of `*roachpb.RangeFeedEvent` is beneficial since this is the (already allocated) event we receive from rangefeed RPC once changefeed completes the initial scan. Release justification: significant reduction of the changefeed impact on the foreground SQL latency. Release note (enterprise change): Changefeeds are more efficient during initial scan and backfill. The impact on runtime GC signficantly reduced, resulting in significant reduction of the changefeed impact on the foreground SQL latency.
Contributor
Author
|
bors r+ |
Contributor
|
Build failed: |
Contributor
Author
|
bors r+ |
Contributor
|
Build succeeded: |
This was referenced Sep 13, 2022
This file contains hidden or 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
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.





Fixes #84709
kvevent.Eventstructure is very inefficient in its use of pointers. The number of pointers in the structure makes go GC processes more expensive, resulting in loss of performance in the cluster.This is particularly clear during the initial scan, when changefeeds rapidly allocate large number of events, which are then (rapidly) releases -- putting pressure on the go runtime GC.
This PR replaces the use of multiple pointers with a single
*roachpb.RangeFeedEvent. The direct use of*roachpb.RangeFeedEventis beneficial since this is the (already allocated) event we receive from rangefeed RPC once changefeed completes the initial scan.Release justification: significant reduction of the changefeed impact on the foreground SQL latency.
Release note (enterprise change): Changefeeds are more efficient during initial scan and backfill. The impact on runtime GC signficantly reduced, resulting in significant reduction of the changefeed impact on the foreground SQL latency.