grpc.max_connection_age_ms for client config?

3,150 views
Skip to first unread message

duelin....@gmail.com

unread,
Oct 11, 2017, 11:11:56 AM10/11/17
to grpc.io
We'd like to avoid holding open a connection for too long from a Ruby client. Based on what documentation we've found[1], we've tried adding `"grpc.max_connection_age_ms" => 30_000` to the `:channel_args` we pass to the stub constructor, hoping to see connections closed after 30 seconds, but it seems to have no effect.

I'm watching for the stub's channel's `connectivity_state` to change from 2 to something else after connecting via either making an RPC call or calling `connectivity_state(true)`. If I wait until the server's configured idle timeout, I see the connectivity_state go to 3, then 0.

Should that channel arg limit the age of client connections? Is there some other way to do that from the client side?

John Hume

unread,
Oct 30, 2017, 5:31:19 PM10/30/17
to grpc.io
Just a follow-up to say I got an answer to this question from Eric Anderson here:

Summary: it's a bug in grpc, and there's work underway to fix it:

Eric Anderson

unread,
Nov 1, 2017, 12:36:34 PM11/1/17
to John Hume, grpc.io
grpc.max_connection_age_ms is a server-side option. For documentation, see gRFC A9 Server-side Connection Management. This should work on server-side without issue. If you're concerned about resources, use grpc.max_connection_idle_ms instead. grpc.max_connection_age_ms is mainly useful when using a TCP-based (L4) load balancer.

The client-side option you're looking for... isn't implemented. I've filed https://github.com/grpc/grpc/issues/13212 . That said, depending on the details of what you're doing, it may be better to use the existing server-side options. (It all depends on whom you're trying to help: use client-side option for client optimization, server-side option for server optimization.)

--
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+unsubscribe@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/8f378432-2662-4694-b7da-511ed1b961ed%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

John Hume

unread,
Nov 1, 2017, 1:20:45 PM11/1/17
to grpc.io
Thanks for the information. Apologies for my previous message, which was follow-up on a completely different question. (I thought I'd asked it in this group, but apparently not.)
Reply all
Reply to author
Forward
0 new messages