Welcome! Log In Create A New Profile

Advanced

Re: keepalive not work with grpc

August 17, 2018 03:36AM
I used protobuf v310, grpc v181, nginx v1152 and v1140.
The server is just same as the example async_server on grpc website.
https://grpc.io/docs/tutorials/async/helloasync-cpp.html
You can use it directly.
https://github.com/grpc/grpc/blob/v1.14.1/examples/cpp/helloworld/greeter_async_server.cc

By the way, there is another problem found in nginx. Maybe you are intersted in it.
After fixing the problem above, I tried more. The rpc service is simple, it just transfers a short string(less than 10 bytes). At first, the grpc client , nginx and grpc server works well together. But after some time, the service stopped. I used the wireshark to check the problem. The last DATA frame from nginx to grpc server is wrong. For example, in correct packet, the DATA length is 13, message in protobuf is "Hunter", so the length of string in protobuf is 6.
protobuf part:
0a 06 48 75 6e 74 65 72.
But the last one is wrong, its DATA frame length is 10, it didn't send the message completely
0a 06 48 75 6e.
Then the grpc server just send back a TCP ACK and ignore the wrong message, finally nginx stop the TCP connection.
Then I test for longer string. When the string length is 1000bytes, it can finish for about 4000 times. When the string length is 500bytes, it turns to 8000+times. I guess some problems may happen in nginx buffer. You could check it , too.
Subject Author Posted

keepalive not work with grpc

hunterqin August 05, 2018 11:21PM

Re: keepalive not work with grpc

hunterqin August 10, 2018 03:10AM

Re: keepalive not work with grpc

Maxim Dounin August 10, 2018 06:20AM

Re: keepalive not work with grpc

hunterqin August 17, 2018 03:36AM

Re: keepalive not work with grpc

Maxim Dounin August 21, 2018 10:00PM

Re: keepalive not work with grpc

hunterqin August 22, 2018 12:07AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 51
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready