-
Notifications
You must be signed in to change notification settings - Fork 5.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
util: improve TopSQL reporter memory efficiency #25195
Conversation
/cc @breeswish @crazycs520 |
Co-authored-by: crazycs <chen.two.cs@gmail.com>
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.
The rest LGTM.
util/topsql/reporter/client.go
Outdated
@@ -28,7 +28,7 @@ import ( | |||
|
|||
// ReportClient send data to the target server. | |||
type ReportClient interface { | |||
Send(ctx context.Context, addr string, sqlMetas []*tipb.SQLMeta, planMetas []*tipb.PlanMeta, records []*tipb.CPUTimeRecord) error | |||
Send(ctx context.Context, addr string, data reportData, decodePlan planBinaryDecodeFunc) error |
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.
decodePlan should be a ReportClient constructor parameter.
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
Signed-off-by: crazycs <crazycs520@gmail.com>
…s is instance Signed-off-by: crazycs <crazycs520@gmail.com>
Signed-off-by: crazycs <crazycs520@gmail.com>
/run-unit-test |
Signed-off-by: crazycs <crazycs520@gmail.com>
/run-all-tests |
2 similar comments
/run-all-tests |
/run-all-tests |
ae23b9d
to
1d5bede
Compare
5cc65cc
to
7dbd857
Compare
Signed-off-by: crazycs <crazycs520@gmail.com>
/run-all-tests |
Signed-off-by: crazycs <crazycs520@gmail.com>
…into improve-topsql-mem
/run-all-tests |
/run-all-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 1ab86ae
|
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.1 in PR #25363 |
What problem does this PR solve?
Problem Summary:
The current TopSQL reporter copies data before sending to gRPC endpoint.
What is changed and how it works?
What's Changed:
Iterate data at send time to reduce a memory copy.
How it Works:
Because the SQL/plan meta could be > 1M for each record, this could potentially save some GB of memory.
Related changes
Check List
Tests
Side effects
None.
Release note