1
votes

Please ignore this question. I had wrong setup which caused poor performance of gRPC.


Is it OK to compare GRPC vs Project Reactor?

I just wanted to compare the performance of REST and GRPC. I do not see that GRPC is any faster than reactor. In fact it is worse.

GRPC set up:

api-server --> grpc-server
  • This grpc server responds 1000 "Hello" using server-side streaming for each request from api-server.
  • The api-server returns Flux<String>

WebFlux Setup:

api-server --> rest-server
  • This rest server responds 1000 "Hello" as Flux<String> for each request from api-server.
  • The api-server returns Flux<String>

I did the performance test for 10000 iterations with 10 concurrent users.

The WebFlux setup is much much faster than GRPC. I am kind of curious if it is gRPC really faster? If yes, in which cases?

Note: The request and response payload is very small in size in both cases.

1
Could you please quantify "much faster" and share qps or similar? There's many ways you can mess up a benchmark, so numbers would be helpful to know if the results are close to expected. How long does the benchmark take to run (wall time)?Eric Anderson
@EricAnderson, Yes, I had wrong understanding. grpc turned out to be faster.RamPrakash

1 Answers

4
votes

have a look at the rsocket protocol https://rsocket.io for something even closer, reactive streams but across the network. grpc has more higher level components for the rpc stuff (stubs generation, etc...) but as a result one could argue rsocket gives you more control