RFC: Switch to GRPC.#3352
Conversation
bdarnell
commented
Dec 8, 2015
|
CC @YuleiXiao |
|
Seems like we get the important benefits at a substantially lower development cost by going to protobuf over HTTP2. We can then switch to GRPC when it becomes compelling in its own right (streaming, perf, adoption). |
|
The performance cost is there whether it's GRPC or plain HTTP/2. And it looks like streaming would have better performance than regular RPCs (no headers), so the performance penalty of GRPC would be smaller than I think that the streaming interface is sufficient reason to choose GRPC over HTTP/2 for internal-only use. The main reason I would choose plain HTTP/2 would be for public APIs, since if GRPC fails to see wide adoption there may not be enough client libraries for it. |
|
Another issue with GRPC is grpc/grpc-go#317 There's no way to track connections as with |
|
Some very rough performance estimates: The main contributor to the performance difference is that GRPC performs 50% more Write syscalls (GRPC does two writes on the server side and one on the client; our own codec does one in each direction). Therefore, we can estimate the performance impact of a move to GRPC by multiplying the time spent in write syscalls by 1.5. The benchmarks in the |
|
The GRPC performance can be fixed. Whether those fixes will be accepted upstream is a different question. |
There was a problem hiding this comment.
FYI, streaming gRPC calls are faster than non-streaming calls. I added something to Tamir's benchmark at some point, but never merged the results. I don't remember the details only that the difference was significant.
There was a problem hiding this comment.
Yes, it's because streaming RPCs don't include headers with every message, so it's just one Write syscall per message. I haven't benchmarked it but on paper streaming mode should be pretty close to our current system. I don't think we can make everything use the streaming mode but it's a good fit for at least raft and gossip.
There was a problem hiding this comment.
I'll find and resurrect my change to rpc-bench so that we have real numbers to look at.