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

Will nuraft do batching ? #210

Open
Steamgjk opened this issue May 10, 2021 · 3 comments
Open

Will nuraft do batching ? #210

Steamgjk opened this issue May 10, 2021 · 3 comments

Comments

@Steamgjk
Copy link

Hi, @greensky00
Just want to confirm, when we followers receive more than 1 request from leader, or when leader has more than 1 request to send to followers, will it send one by one, or will it batch them into one, and then send?

@greensky00
Copy link
Contributor

@Steamgjk
It does batching.

/**
* Max number of logs that can be packed in a RPC
* for append entry request.
*/
int32 max_append_size_;

@Steamgjk
Copy link
Author

Steamgjk commented May 10, 2021

@greensky00
The default value is 100.
If I only submit 1 request, will the request be sent immeidately, or will it wait for a timeout, or until it has accumulated 100 requests (I think it is not this case)? I mean, there are expected to be at least two conditions that can trigger an RPC. The first one is to reach the batch size, and the second one is to reach a timeout. So what is the timeout length?

@greensky00
Copy link
Contributor

@Steamgjk
If the connection to a follower is idle, the request is sent immediately. If the previous request is in flight, the next requests are sent as soon as it gets a response to the previous request. In that case, the next batch size will be min(number of pending requests, max_append_size_). There is no such threshold on timing or size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants