-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Report QPS about each type of command in RegionHeartbeat and StoreHeartbeat #8157
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
Conversation
c8e518f
to
0dc9c58
Compare
b8623ab
to
989fe0f
Compare
|
1 similar comment
|
6f08ab0
to
00d70b0
Compare
/run-test |
/rebuild |
/cc @Yisaer |
This PR lasts too long. |
Cargo.lock
Outdated
@@ -2217,7 +2217,7 @@ dependencies = [ | |||
[[package]] | |||
name = "kvproto" | |||
version = "0.0.2" | |||
source = "git+https://github.com/pingcap/kvproto.git?rev=511a3225c29f9272af83d28efed92eba835cd34f#511a3225c29f9272af83d28efed92eba835cd34f" | |||
source = "git+https://github.com/lhy1024/kvproto.git?rev=881f9799e333c2464c20b647da831ed5c9013d43#881f9799e333c2464c20b647da831ed5c9013d43" |
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.
Why lhy1024 branch?
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.
After pingcap/kvproto#638 merged, it will be replaced with pingcap branch.
@@ -1114,6 +1114,7 @@ where | |||
"peer_id" => self.fsm.peer_id(), | |||
"res" => ?res, | |||
); | |||
res.metrics.written_query_num += 1; |
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.
It's better in fsm/apply.rs
, and the ApplyTaskRes
is received after the ApplyPoller
call end, it's may handle many commands in one poller round.
Signed-off-by: lhy1024 <admin@liudos.us>
@@ -427,6 +437,7 @@ where | |||
|
|||
const HOTSPOT_KEY_RATE_THRESHOLD: u64 = 128; | |||
const HOTSPOT_BYTE_RATE_THRESHOLD: u64 = 8 * 1024; | |||
const HOTSPOT_QUERY_RATE_THRESHOLD: u64 = 8; // TODO: need more test |
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.
I think it's too small, assume the bytes 1 key have 64 bytes, it should be 128.
Signed-off-by: lhy1024 <admin@liudos.us>
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.
rest LGTM
region_peer.last_store_report_read_bytes = region_peer.read_bytes; | ||
region_peer.last_store_report_read_keys = region_peer.read_keys; | ||
info!("read peer qps";"region id"=>region_id,"qps"=>read_query_stats.get_read_query_num()); |
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.
Does this log need to be deleted? it's only for debug?
.store_stat | ||
.engine_total_query_num | ||
.sub_query_stats(&self.store_stat.engine_last_query_num); | ||
info!("read store qps";"store id"=>stats.get_store_id(),"qps"=>res.get_read_query_num()); |
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.
due too. or better with metrics.
@@ -1488,6 +1488,7 @@ where | |||
); | |||
}); | |||
} | |||
self.metrics.written_query_num += 1; |
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.
also need for handle_delete
Signed-off-by: lhy1024 <admin@liudos.us>
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, plz update kvproto
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
/merge |
@lhy1024: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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. |
This pull request has been accepted and is ready to merge. Commit hash: c534edf
|
|
||
[patch.'https://github.com/pingcap/kvproto.git'] | ||
kvproto = { git = "https://github.com/lhy1024/kvproto.git", rev = "dda0a102bc6ac7371e1f99cd2797825aa210b4a0", default-features = false } |
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.
Is here on purpose or by accident?
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.
Sorry, an accident.I will fix it later.
@@ -1432,9 +1433,22 @@ where | |||
for req in requests { | |||
let cmd_type = req.get_cmd_type(); | |||
let mut resp = match cmd_type { | |||
CmdType::Put => self.handle_put(ctx.kv_wb_mut(), req), | |||
CmdType::Delete => self.handle_delete(ctx.kv_wb_mut(), req), | |||
CmdType::Put => { |
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.
Just counting the QPS at apply module can't cover all scenarios, there is a big different CPU cost in grpc and raftstore between 1 request put 100kv and 100 reqeusts with each request puts 1 kv.
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.
emmm, maybe statistics should be placed at a higher level?
What problem does this PR solve?
Issue Number: close tikv/pd#2526
Problem Summary: Report QPS about each type of command in RegionHeartbeat. for the multi-dimensions hotspot scheduling.
What is changed and how it works?
What's Changed:
Add Grpc info in tls_collect_qps
Related changes
pingcap/kvproto
Check List
Tests
Release note