-
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
changefeedccl: Make kvevent.Event memory efficient #87718
Conversation
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, |
@nvanbenschoten : FYI |
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.
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.
bors r+ |
Build failed: |
bors r+ |
Build succeeded: |
Fixes #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.