-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Stream Batching #524
Comments
This will be tricky because batching might enlarge latency. We have some minimal deliberate batching support in the code already. But how to enhance it to maximize throughput without hurting latency is complex and need more time. Performance would be one of our main focus next quarter. |
@iamqizhao Are we open to add a Flush() method to stream to enable user controlled batching? |
This would be tricky on the interaction with Flush decision on the transport layer. |
@iamqizhao, Go's http2 server does this aggregation automatically. It has a write scheduler that only flushes only when a packet is full or there's nothing else to send. So if we switch, I think this should get a lot easier to control. (or ideally: not control, if it just works) |
@bradfitz , as I mentioned, the current grpc transport does this automatically too (may be different from what http2 does). The problem is that whether Flush knob should be exposed to users. |
We are working on batching requests this quarter to improve perf. Will update this thread with available date soon. |
@dfawley assigning to you to triage and make a decision on exposing the |
We discussed this today at some length. Without major API changes or hacks (i.e. passing a magic wrapper type to |
We changed out write mechanism to use a dedicated loop to write which essentially solves the batching problem. |
Hi, we noticed 6x throughput improvement if we stream 100 byte messages in a batch of 50 (e.g. one response message with repeated field) rather than streaming them one by one. So are there plans to add support for batching in the streaming implementation?
Thanks,
Kiril
The text was updated successfully, but these errors were encountered: