gRPC C++ stream throughput performance significantly slower on windows vs. linux

1,657 views
Skip to first unread message

justin.c...@gmail.com

unread,
Aug 22, 2018, 9:55:05 PM8/22/18
to grpc.io
Background:

Machine: ~3.0Ghz, 8 cores (4 logical), 32.0 GB RAM

I was looking into grpc performance on large amounts of data to see if it was viable for our use, data size could be over 10GB. The basic payload would just be an array of floats. Using a synchronous server/client and streams on linux I was able to get around 1.3GB/s throughput on a message. This was by streaming the data in ~200-300KB chunks. When the chunks go above 1MB the throughput starts to slow down, < 100KB chunks start to greatly slow down as well, < 1MB seemed to be a good sweet spot. Sending large non-streamed messages was much lower < 500MB/s, so streams seemed the way to go.

Tried the same tests that yielded ~1.3GB/s (on linux) on windows (win10). Those same tests achieved ~300MB/s on windows.

Question:

Is there a good way to increase performance on windows (or just in general) for large streamed messages? We like some of the benefits of grpc/protobufs, especially the ability to just send a client a proto file so they can write their own client in their choice of language. I was expecting a decrease in performance on windows but not by that magnitude. We aren't looking at changing the underpinnings of gRPC for this project. Mainly looking at if there are some good ways to increase performance of streams on windows (particularly on the server side).

We have plenty of other options to get optimal data rate transfers but were hoping we could use gRPC out of the box so we could hand a client a proto file and they could handle the "rest".

Very new to gRPC/protobufs so I could be missing a lot of things so I might be missing some crucial information.

Thanks!

suji...@gmail.com

unread,
Nov 21, 2018, 11:19:15 PM11/21/18
to grpc.io
Hi Justin,

We are new to gRPC(just started looking into yesterday) and were looking for something similar in linux. Its great to see that you have achieved  1.3 GB/sec throughput. Could you please let know what are all the things considered to get this ? When you say 1.3 GB/sec , is it 1.3 GB of data being sent and received over the network by splitting the large data into smaller messages(chunks) and sending them in parallel? Are there any sample code related to data transfer we can start with? Any help will be greatly appreciable. 

Thanks & Regards
Sujit

justin.c...@ansys.com

unread,
Nov 26, 2018, 1:10:22 PM11/26/18
to grpc.io
Hey Sujit,

We didn't want to go into complicated client solutions so we didn't go as far as sending the data in parallel to the server. Mainly looked at using messages vs. streams. Messages by default need to be 1 or 2 MB or smaller (forget which). You can increase the max send/recv size on the channel_args but the larger your messages the slower they will transer, and there is a ~2GB payload size for a message.

Instead we just used streams and partition the data into chunks <= 250KB.

For examples I'd pull down the grpc git repo and look at the examples in grpc/examples. The grpc/examples/protos directory contains all the proto files used in the examples. Also look in the https://grpc.io/docs/ for specific guides for the language you are using. Simple google searches such as "grpc c++ client stream" etc. will also lead to a lot of examples. The c++ route_guide (https://github.com/grpc/grpc/tree/master/examples/cpp/route_guide) is a good one to look at for a streaming example in c++. Has bi-directional streaming in it.

-Justin
Reply all
Reply to author
Forward
0 new messages