-
Notifications
You must be signed in to change notification settings - Fork 399
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
[WIP] Add cluster benchmark #315
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Fullstop000 <fullstop1005@gmail.com>
Sample output:
|
Is this the error?
|
Yes, it's the problem. I limit both the sample count and measurement time to make the benchmark running time in an acceptable range temporarily. But the benching result seems not very desirable. Maybe the implementation brings too many overheads by channels and mutexes. |
Yeah, I think at this point we're mostly benchmarking channels and overheads of the benchmark itself. :( That is kind of the realistic case though, most raft clusters are running over networks and this have much more network overhead than CPU time. I wonder if it might be more valuable to try to capture the time it takes for a node (the leader and probably separately a follower) to process a received message from a client or other node, and then respond. This way we could perhaps avoid measuring the channel/mutex times? |
I start to believe that the channel-based cluster is hard to be benched by So I re-consider the problem: the target is to measure the speed of committing logs which means we need to calculate the duration between the proposing and consuming the corresponding committed entry per proposal. Therefore, maybe we don't need an async communication style cluster since we can simulate things described above just in the leader node.
And now we can have a total sync-styled process in the leader node and measure the duration easily without any overheads. What do you think about this idea? @Hoverbear @hicqu |
@Fullstop000 So you'd mock the non-leader actions? |
@Hoverbear Yes, though I still want a benchmark over the channel-based cluster (maybe create a specialized harness for this?). And I realize that by the no overhead approach the whole routine is composed of several function calls and an RTT: Leader |
Seems to make sense to me :) |
Part of #109
This PR tries to add a benchmark for the real raft node cluster. The communication between nodes is supported by
mspc::channel
which brings some overhead.@Hoverbear @hicqu
Problems
Criterion complains about that benchmark time will be too long. Consider using raw benching.Official#[bench]
is an unstable feature.Signed-off-by: Fullstop000 fullstop1005@gmail.com