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

*:Speed up parse slow-log when query slow_query #15371 (#19139) #20556

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Oct 21, 2020

cherry-pick #19139 to release-4.0


What problem does this PR solve?

Issue Number: close #15354

Problem Summary:
After Issue #15354 laster, the performance improvement is not significant. The Read slow log file and parse process are slow.

What is changed and how it works?

What's Changed:
In the slow log query process, the two steps of reading the log and parsing the log have been serialized. Here, the step of parsing the log is put into the go routine to make it concurrent.

For query 300M tidb-slow.log:
-- before this PR;
251597216170_ pic
Spend 4.75s

-- this PR;
261597216224_ pic
Spend 1.25-1.30s

Improve slow log query efficiency by 4 times.

How it Works:
the step of parsing the log is put into the go routine to make it concurrent.

Related changes

  • PR to update pingcap/tidb/executor/slow_query.go:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test

Side effects

  • Performance regression
    • Improve slow log query efficiency by 4 times

Release note

  • Speed up parse slow-log when query slow_query.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot added contribution This PR is from a community contributor. sig/execution SIG execution type/4.0-cherry-pick labels Oct 21, 2020
@ti-srebot ti-srebot added this to the v4.0.8 milestone Oct 21, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Oct 21, 2020

@ti-srebot ti-srebot self-assigned this Oct 21, 2020
Signed-off-by: jyz0309 <45495947@qq.com>
@sre-bot
Copy link
Contributor

sre-bot commented Oct 21, 2020

@crazycs520
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 21, 2020
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 21, 2020
@crazycs520
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @crazycs520, this branch cannot be merged without an approval of release maintainers

@ti-srebot ti-srebot added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Oct 21, 2020
@SunRunAway
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 21, 2020
@SunRunAway
Copy link
Contributor

/rebuild

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit ba9fe30 into pingcap:release-4.0 Oct 21, 2020
@jyz0309 jyz0309 deleted the release-4.0-c04bda6db7a1 branch October 21, 2020 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants