0

Am working on a project using GRPC which has a node js server and client is Android written in Kotlin. We are able to setup the connection and the server streaming works as expected.

The problem we are seeing is the server is pinging to client every 30 seconds for keepalive, even though we have kept the keep alive time as 5 minutes.

const options = { 'grpc.keepalive_permit_without_calls': false, "grpc.keepalive_time_ms": 300000 };

On client side

val builder = ManagedChannelBuilder.forAddress(ipaddress, portno)
                .keepAliveTime(5, TimeUnit.MINUTES)
                .keepAliveWithoutCalls(false)
                .proxyDetector { null }
                .usePlaintext()
            channel = builder.build() 

From wireshark logs I can see that the server is pinging the client every 30 seconds, is there any way to increase the time frame for pinging? If yes what is the maximum time frame we can keep and what are the code changes to be done ?

user
  • 87
  • 8
  • are you talking about http2 PING frames? Those could be pings for BDP calculations and cannot be disabled with keepalive settings. But they are issued only when there are RPCs in flight, so you still have other frames around same time. What is your concern regarding these pings? – Yuri Golobokov Jan 12 '23 at 19:55
  • @YuriGolobokov, am worried about the server load and data. We are trying to implement GRPC in few thousands of client devices. If the server is pinging clients every 30 seconds for keep alive and in return client sends a keep alive ack , am worried about the load and data in server when it hit such a large number of clients / devices. – user Jan 13 '23 at 05:58
  • have you set the keepalivetime for the serverbuilder as well? https://github.com/grpc/grpc-java/blob/2fc7ac441c74454dd91da64810dac0620adebc24/api/src/main/java/io/grpc/ServerBuilder.java#L256 – Yuri Golobokov Jan 17 '23 at 17:58
  • @YuriGolobokov, sever is in node js and the code snippet we added is `const options = { 'grpc.keepalive_permit_without_calls': false, "grpc.keepalive_time_ms": 300000 };` – user Jan 19 '23 at 04:38

0 Answers0