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
*: add metrics about raft message wait flush duration #16214
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
[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. |
@cfzjywxk @overvenus PTAL |
Signed-off-by: crazycs520 <crazycs520@gmail.com>
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.
So why the wait flush duration is so high
In the monitoring by PR description, I restarted 2 TiKV servers every 2 minutes. During restart, wait flush duration was too high probably by waiting for the connection to be established. However, the reason for the high wait flush latency at other times is not known |
@overvenus @cfzjywxk PTAL |
@crazycs520 |
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 don't get the meaning of the metric. Think about the following case, observe(t5-t1)
can be thought as the flush wait duration of m1, but how to understand observe(t8-t6)
?
t1: push(m1) record_begin_wait
t2: push(m2)
t3: push(m3)
t4: push(m4)
t5: flush([m1,m2]) take_begin_wait observe(t5-t1)
t6: push(m5) record_begin_wait
t7: push(m6)
t8: flush([m3,m4]) take_begin_wait observe(t8-t6)
t9: flush([m5,m6])
Nice catch. But this shouldn't happen. since the default config is: raft_client_queue_size = 8192;
raft_client_grpc_send_msg_buffer = 512 * 1024; So each flush will send all messages in the queue. So the example should be:
I don't record the timestamp for each message to avoid performance issues. |
According to the code, the capacity of the buffer is
|
It seems that when send buffer overflow, this monitoring will be inaccurate, which is smaller than the actual flush wait time |
PR needs rebase. 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 kubernetes/test-infra repository. |
@crazycs520 @zyguan PTAL again |
It seems there is no change since my last review. The issue of the current implementation is that the observed duration is not well defined, which may lead to:
The raft client can be described as the following (note grpc_raft_conn_num can be greater than 1). IMO, push events and flush events are relatively independent. |
What is changed and how it works?
Issue Number: ref #12362
What's Changed:
In following metrics, I restarted 2 TiKV servers every 2 minutes. During restart, raft message wait flush duration was high probably cause by waiting for the connection to be established. However, the reason for the high wait flush latency at other times is not known.
Related changes
Check List
Tests
Side effects
Release note