Optimize for streaming large amount of small messages

562 views
Skip to first unread message

ran...@addepar.com

unread,
Mar 31, 2017, 6:00:15 PM3/31/17
to grpc.io
I have a Grpc service that streams large number of small messages to client, and I noticed that the streaming throughput improved when I changed the rpc to stream a batch of small messages at once.
There are two questions:
1. why the performance improved?
2. why doesn't grpc do similar optimization internally?


Best
Ran

Craig Tiller

unread,
Mar 31, 2017, 6:01:30 PM3/31/17
to ran...@addepar.com, grpc.io
Which language are you using?

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/d7391932-213b-46bf-b8a1-2ee5e144950a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ran...@addepar.com

unread,
Mar 31, 2017, 6:06:16 PM3/31/17
to grpc.io, ran...@addepar.com
I am using grpc-java.

Louis Ryan

unread,
Apr 3, 2017, 8:57:56 AM4/3/17
to ran...@addepar.com, grpc-io
This is expected as with streaming we rely on timing to coalesce small writes whereas with batching you can precisely control the number of messages in a write to the socket.

There's an open issue (and prototype) for corking which allows you to control the grain of writes to a socket without needing to change your service definition

-louis (from phone)

To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.

Ran Bi

unread,
Apr 3, 2017, 1:58:11 PM4/3/17
to Louis Ryan, grpc-io
Thanks for the reply! 

Reply all
Reply to author
Forward
0 new messages