grpc streaming and loadbalancer close connections?

232 views
Skip to first unread message

cr2...@gmail.com

unread,
May 30, 2017, 7:18:39 PM5/30/17
to grpc.io
For streaming api have there been issues reported where the is no activity that load balancers would close connections?
For Node there is this being reported https://jira.hyperledger.org/browse/FAB-2787
However when I read the Java spec  http://www.grpc.io/grpc-java/javadoc/io/grpc/ManagedChannelBuilder.html#idleTimeout-long-java.util.concurrent.TimeUnit-
It seems to indicate that once it leaves the initial idle state it by default will not go back to idle.

cr2...@gmail.com

unread,
May 30, 2017, 7:29:06 PM5/30/17
to grpc.io, cr2...@gmail.com
If not in idle mode can or does grpc implement some sort of keep alive ?


Message has been deleted

cr2...@gmail.com

unread,
May 30, 2017, 7:41:44 PM5/30/17
to grpc.io, cr2...@gmail.com
Currently Node client is looking to fix this doing a heartbeat at the application level. Sending NOP messages  This seem like something grpc/http2 should handle.  Load balancers are very common.
Don't this is off the bat a good way to fix this if it is even an issue for Java

Michael Lumish

unread,
May 30, 2017, 8:01:37 PM5/30/17
to cr2...@gmail.com, grpc.io
For the Node client, I think you can enable keepalive HTTP2 pings using the channel argument "grpc.keepalive_time_ms" as defined at https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/grpc_types.h#L230. This argument is passed in the options object, which is the third argument to the Client constructor.

On Tue, May 30, 2017 at 4:41 PM <cr2...@gmail.com> wrote:
Currently Node client is looking to fix this doing a heartbeat at the application level. Sending NOP messages  This seem like something grpc/http2 should handle.  Load balancers are very common.
Don't this is off the bat a good way to fix this if it is even an issue for Java

--
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/3cc62500-4979-4c04-8f21-573ac4ae2cb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cr2...@gmail.com

unread,
May 30, 2017, 8:21:32 PM5/30/17
to grpc.io, cr2...@gmail.com
Thanks that's really great information.  How about Java ?  Does Java do this too ?

cr2...@gmail.com

unread,
May 30, 2017, 8:58:56 PM5/30/17
to grpc.io, cr2...@gmail.com
I Just noticed that NettyChannelBuilder has a keep alive option.

cr2...@gmail.com

unread,
May 30, 2017, 9:19:45 PM5/30/17
to grpc.io, cr2...@gmail.com
Some education please on the NettyChannelBuilder vs ManagedChannelBuilder.  Code I inherited used ManagedChannelBuilder for grpc (non-TLS) and NettyChannelBuilder for grpcs (TLS).  So NettyChannelBuilder is a subclass of ManagedChannelBuilder with more options.   Is there any reason to not just use both for grpc and grpcs ?  I think in both cases we'll want to set the keepalive option
Thanks!

Eric Anderson

unread,
Jun 1, 2017, 7:26:30 PM6/1/17
to cr2...@gmail.com, grpc.io
When you can, use ManagedChannelBuilder. It will auto-choose which transport, so Netty vs OkHttp, and has a stable API. We provide more advanced options in NettyChannelBuilder but it isn't a stable API. You should be able to use both TLS and plaintext with ManagedChannelBuilder.

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.
Reply all
Reply to author
Forward
0 new messages