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

diagnose: try to differentiate between internal and external requests #33963

Closed
3 tasks
cfzjywxk opened this issue Apr 14, 2022 · 4 comments · Fixed by #34833
Closed
3 tasks

diagnose: try to differentiate between internal and external requests #33963

cfzjywxk opened this issue Apr 14, 2022 · 4 comments · Fixed by #34833
Labels
sig/diagnosis SIG: Diagnosis sig/transaction SIG:Transaction type/enhancement The issue or PR belongs to an enhancement.

Comments

@cfzjywxk
Copy link
Contributor

cfzjywxk commented Apr 14, 2022

Enhancement

Currently the tidb-server could trigger several different types of internal requests, they could be triggered by some background tasks such as auto analyze, statistics feedback, ddl backfill, gc resolve lock, gc unsafe destroy range, etc. Also, the entries are different some of them may use ExecRestrictedSQL and some may use raw transaction interfaces. These requests would be turned into kv requests just like the user kv requests, but there's no way to differentiate them conveniently.

As these internal requests could use resources and affect the performance when the resources are limited on the cloud, it's difficult to do the performance tuning if the current bottleneck is introduced by some ongoing background tasks. To make the performance diagnosis easier, we could add separate tags for these internal kv requests and try to display how many resources are used by them so that it could be much easier to tell if the internal tasks affect the cluster performance a lot.

The detailed work plan is:

  • Add a flag for the internal request in the RPC context of kvproto.
  • Use this flag in requests generated by all the internal SQL execution or raw transaction command execution.
  • Add or adjust corresponding monitor metrics in both tidb and tikv panels. For the tikv panel, we could distinguish the resources(the thread worker, read/write flow) used by internal requests and their impact on performance.

Note this is just to enhance the path from tidb to tikv, there're still some background tasks like peer move, data compaction in the tikv side, these internal tasks could be discussed in another document.

@cfzjywxk cfzjywxk added type/enhancement The issue or PR belongs to an enhancement. sig/transaction SIG:Transaction sig/diagnosis SIG: Diagnosis labels Apr 14, 2022
@cfzjywxk
Copy link
Contributor Author

For the internal request tracking enhancement, I've created a tracking issue here.
/cc @you06 @sticnarf @youjiali1995

@BornChanger
Copy link
Contributor

Please be kindly reminded, there is a related pr. Make sure we are on the same page and no dup work.
image

@sticnarf
Copy link
Contributor

Please be kindly reminded, there is a related pr. Make sure we are on the same page and no dup work. image

Thanks for the reminder.

This issue is much more systematic work, trying to labeling all requests with their sources. Maybe we will reimplement #34861 with more unified mechanisms.

@you06
Copy link
Contributor

you06 commented Jun 29, 2022

Maybe we will reimplement #34861 with more unified mechanisms.

#34861 pushed InRestrictedSQL flag into DAG requests only, we can move such flag into the KV context and separate request_source into request_source and request_scope, but it makes other TiKV user confused because they don't have the knowledge about "internal" requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/diagnosis SIG: Diagnosis sig/transaction SIG:Transaction type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants