0

I am using grpc-go and want to use nginx for load balancing, but I do not understand why grpc_pass gives much worse results?

Benchmark test:

upstream "go_grpc" {
     server 127.0.0.1:10000;
}
server {
         listen 11000;
         proxy_pass go_grpc;
}

Processed 10,000 requests in 5 seconds

Via stream{}:

upstream "go_grpc" {
     server 127.0.0.1:10000;
}
server {
         listen 11000 http2;
         location / {
             grpc_pass grpc://go_grpc;
         }
}

Processed 10,000 requests in 10 seconds (2 times longer)

Sparks
  • 1
  • Probably because `grpc_pass` does more than `proxy_pass`. If you don't need the additional features exposed by `grpc_pass`, you might as well use whichever performs better. – Adrian Oct 30 '20 at 16:12
  • @Adrian `proxy_pass` works faster, but unstable. – Sparks Oct 30 '20 at 16:24

0 Answers0