GRPC_ARG_KEEPALIVE_TIME_MS vs GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS

58 views
Skip to first unread message

tobias....@dentsplysirona.com

unread,
Aug 5, 2020, 11:58:27 AM8/5/20
to grpc.io
Hi,
can somebody explain the relation between these two time settings on a client perspective?

It seems to me, that GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS is the lower limit for GRPC_ARG_KEEPALIVE_TIME_MS.
But why does this GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS exists at all, when I control the rate of the ping with the KEEP_ALIVE time?

I need to detect the interruption of long living streaming channels, that might not transport any data for minutes or even hours.



Thanks
Tobias

yas...@google.com

unread,
Aug 5, 2020, 7:06:43 PM8/5/20
to grpc.io
Hi,

You are right. It is definitely not user friendly for someone trying to set up keepalives to also have to set GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS. I believe the reason for this is mostly to deal with the fact that pings in gRPC Core can originate via either of 3 methods -
1) Keepalive
2) BDP
3) grpc_channel_ping()

I can think of a few possible ways to improve experience here -
1) Reduce the default value of GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS
2) Use the minimum of GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS and GRPC_ARG_KEEPALIVE_TIME_MS to set the minimum ping interval without data.
3) Make GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS defunct.

tobias....@dentsplysirona.com

unread,
Aug 6, 2020, 1:19:23 AM8/6/20
to grpc.io
Hi,
thanks for your reply and clarifying the facts.


On Thursday, August 6, 2020 at 1:06:43 AM UTC+2, yas...@google.com wrote:
Hi,

You are right. It is definitely not user friendly for someone trying to set up keepalives to also have to set GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS.

Yes. It is definitely confusing as the Keep Alive User Guide claims that 

The above two channel arguments should be sufficient for most users, 

So you get the impression, that you need not worry about the other switches.

 
I believe the reason for this is mostly to deal with the fact that pings in gRPC Core can originate via either of 3 methods -
1) Keepalive
2) BDP
3) grpc_channel_ping()

The last one seems to be removed in the near future (https://github.com/grpc/grpc/issues/17857)
 
Thanks again. 
Reply all
Reply to author
Forward
0 new messages