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

store/tikv: enlarge default committer-concurrency to avoid queuing #23720

Merged
merged 5 commits into from
Mar 31, 2021

Conversation

youjiali1995
Copy link
Contributor

@youjiali1995 youjiali1995 commented Mar 31, 2021

Signed-off-by: youjiali1995 zlwgx1023@gmail.com

What problem does this PR solve?

Issue Number: close #22516

Problem Summary:

The default committer-concurrency(16) is too small. It results in queuing in TiDB if a transaction has more than 16 requests.

What is changed and how it works?

What's Changed:

Enlarge the default value to 128. Committer concurrency is introduced in v4.0 to reduce pressure(server is busy) on TiKV. However, I have met several times the performance is bad due to queuing in TiDB. I prefer enlarging the default value to making TiKV less pressure.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • No code

Side effects

Release note

  • No release note

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
@ti-chi-bot ti-chi-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 31, 2021
@youjiali1995
Copy link
Contributor Author

/run-monitor-test

@sre-bot
Copy link
Contributor

sre-bot commented Mar 31, 2021

Visit the grafana server at: http://172.16.5.5:31868, it will last for 5 hours

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 31, 2021
@@ -1644,7 +1644,7 @@ func (batchExe *batchExecutor) process(batches []batchMutations) error {
}
}
close(exitCh)
metrics.TiKVTokenWaitDuration.Observe(batchExe.tokenWaitDuration.Seconds())
metrics.TiKVTokenWaitDuration.Observe(float64(batchExe.tokenWaitDuration.Nanoseconds()))
Copy link
Contributor

Choose a reason for hiding this comment

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

The tokenWaitDuration is a duration type which has nano second count, but in #17268 the observed value is changed to seconds(see the grafana picture in 17268). I'm a bit confused which is correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

The bucket is defined to be Buckets: prometheus.ExponentialBuckets(1, 2, 34), // 1ns ~ 8s. The base is 1, so it should be a nanosecond.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's expected to be observed in nanoseconds. #17268 doesn't fix this. The root cause is the mismatch between the metric and the grafana panel.

	TiKVTokenWaitDuration = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "batch_executor_token_wait_duration",
			Buckets:   prometheus.ExponentialBuckets(1, 2, 34), // 1ns ~ 8s
			Help:      "tidb txn token wait duration to process batches",
		})

@youjiali1995
Copy link
Contributor Author

@cfzjywxk PTAL

Copy link
Contributor

@cfzjywxk cfzjywxk 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-chi-bot
Copy link
Member

@cfzjywxk: Please use /LGTM instead of LGTM when you want to approve the pull request by comment.
If you use the GitHub review feature, please approve the PR directly, the comment will not take effect in the GitHub review feature.
If you have any qustions please refer to lgtm command help or lgtm plugin design.

If you have approved this PR, please ignore this reply. This reply is being used as a temporary reply during the migration of the new bot and will be removed on April 1.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • cfzjywxk
  • sticnarf

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 31, 2021
@cfzjywxk
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: d3b1543

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 31, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #23775

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 31, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #23776

youjiali1995 added a commit to ti-srebot/tidb that referenced this pull request May 7, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/config needs-cherry-pick-release-5.0 sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metric batch_executor_token_wait_duration is incorrectly recorded
6 participants