0

I noticed that a maintainer of gRPC suggested using MAX_CONNECTION_AGE to load balance long lived gRPC streams in their video, Using gRPC for Long-lived and Streaming RPCs - Eric Anderson, Google. I also found an implemented proposal which only lists C, Java and Go:

Status: Implemented
Implemented in: C, Java, Go

In practice, how do I use MAX_CONNECTION_AGE in a python server?

1 Answer 1

2

You can use grpc.server()'s options argument:

options – An optional list of key-value pairs (channel_arguments in gRPC runtime) to configure the channel.

You would use GRPC_ARG_MAX_CONNECTION_AGE_MS, defined in grpc_types.h:

/** Maximum time that a channel may exist. Int valued, milliseconds.
 * INT_MAX means unlimited. */
#define GRPC_ARG_MAX_CONNECTION_AGE_MS "grpc.max_connection_age_ms"

For 30 days as suggested in Using gRPC for Long-lived and Streaming RPCs - Eric Anderson, Google, GRPC_ARG_MAX_CONNECTION_AGE_MS should be 2592000000 (30*24*60*60*1000)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.