-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Performance Diagnosis Enhancements #34106
Comments
Generally, get TS can be devided into 2 types: async and sync. The async way is only used in txn or stmt start. The sync way is used in the following cases:
So we may just tag the TSO duration in such 2 type and also show like this. |
The lock contention may have a significant impact on cluster performance and query latency. Currently, there's no convenient way to do the diagnosis work. Usually, the performance insight is requested to answer:
As |
Since #33963 introduces the request source for metrics, we may attach this information to more metrics, including memory tracking, acquired locks, etc. |
@zyguan @you06
The tikv internal part is recorded as
So maybe we could try to improve the first step, and then we could verify more parts: |
Enhancement
TiDB users often suffer from performance diagnosis when trying to tune the cluster to make it most adaptive to their workloads. Some missing metrics in the system may block the diagnosis and make the tuning hard. To solve the problem, more details of queries and more metrics are required.
Data to be collected
Common Path
The common path includes the processes before a query is executed, connection handling, parsing, and optimization.
Read
The read requests are mainly processed in executors, and they can be divided into calculation executors and data source executors. TiDB reads data by get, batch-get, scan(iter, only used by internal txn), and coprocessor(unary request only). When TiD reads with some error, like lock error or network error, it’ll automatically retry, such retry time should be recorded, and all requests except the last successful one should be counted as retry duration.
Get
BatchGet
Coprocessor
Scan
UnionScan
Resolve lock For Read
Write
Write requests are cached in TiDB’s memory before transactions are committed. In which pessimistic transactions will fetch pessimistic locks during the execution. And some write operations are based on the read results.
Pessimistic lock
Prewrite
Non Async Commit
Async Commit
Batch KV Client
Batch System
gRPC
Region Cache
Data to be verified or enhanced
Reference
The text was updated successfully, but these errors were encountered: