Support for keepalive without calls

1,037 views
Skip to first unread message

John Hume

unread,
Nov 16, 2017, 1:06:44 PM11/16/17
to grpc.io
We're trying to keep connections alive between Ruby grpc clients and a grpc-java server between unary rpc calls, which sometimes come minutes apart. Based on https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md, we think this should be supported with periodic PINGs to ensure a connection is still good. (Without the changes described below, our connections sometimes seem to die without the client realizing it, resulting in "14:Connect Failed" on the next call. This happens especially often when the next call comes very close to the server's maxConnectionIdle time after the previous call.)

On the Ruby client side, we've configured the following.

    "grpc.keepalive_permit_without_calls" => 1,
    "grpc.keepalive_time_ms" => 11_000,

On the Java server side, we've configured the following (NettyServerBuilder calls).

    .permitKeepAliveWithoutCalls(true)
    .permitKeepAliveTime(10, TimeUnit.SECONDS)

In testing this with debug logging on the server, we see an INBOUND PING 11 seconds after the first call (followed immediately by an OUTBOUND ack). Then after another 11 seconds we see an INBOUND SETTINGS (followed by an outbound ack). Then we see no more pings. We expected to see PINGs every 11 seconds.

Is there configuration we're missing to get periodic PINGs between rpc calls? Have we misunderstood the feature?

John Hume

unread,
Nov 16, 2017, 6:07:25 PM11/16/17
to grpc.io
It looks like we were missing grpc.http2.min_time_between_pings_ms on the Ruby client side. With that set to 10_000 and the previously mentioned config, we're now seeing periodic pings every 11 seconds.

abhisekm...@gmail.com

unread,
Mar 7, 2019, 12:42:41 AM3/7/19
to grpc.io
Hey then what is the use of grpc.keepalive_time_ms?

Ankit Bansal

unread,
Mar 7, 2019, 1:01:08 PM3/7/19
to abhisekm...@gmail.com, grpc.io
I think you would probably need to set an attribute for max pings without data which by default is 2. You can look at this link  https://github.com/grpc/grpc/blob/master/doc/keepalive.md for more details.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/7bb3b0fe-0acc-4bd2-aaa9-41f7ff226b23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages