google-cloud-cpp icon indicating copy to clipboard operation
google-cloud-cpp copied to clipboard

Use `GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL` to create separate gRPC subchannels

Open coryan opened this issue 3 years ago • 2 comments

I am told that using GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL (aka "grpc.use_local_subchannel_pool"):

https://github.com/grpc/grpc/blob/1475ed4fb72b6d52bb02b84abd1a6dc69e293b2f/include/grpc/impl/codegen/grpc_types.h#L440-L442

is more efficient than using the "grpc.channel_id":

https://github.com/grpc/grpc/blob/1475ed4fb72b6d52bb02b84abd1a6dc69e293b2f/include/grpc/impl/codegen/grpc_types.h#L445-L446

We should change the code generator and any place where we manually configure the channel id.

coryan avatar May 04 '22 20:05 coryan

I won't have time to work on this.

coryan avatar Sep 16 '22 18:09 coryan

@coryan Do we want this in all libraries, or just the ones that use multiple channels (which aren't currently generated)?

If we want it in all libraries, we can use this strategy: https://github.com/googleapis/google-cloud-cpp/issues/9842#issuecomment-1249963903

dbolduc avatar Sep 17 '22 00:09 dbolduc

I am not sure there is a universal default. Many services are fine with one socket, the request count is too low to justify anything else.

For the services where this matters (Pub/Sub, Pub/Sub Lite, BigTable, BigQuery Storage, Spanner, Storage, probably Speech-to-Text, Text-to-Speech, Dialogflow, and likely anything using a streaming RPC) this probably matters.

Maybe this would work as a rule of thumb:

  • All services that have a streaming RPC should default to setting GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL == 1.
  • We need a way for applications to override the default (whatever it is).

coryan avatar Nov 29 '22 14:11 coryan

No time to work on this right now. Closing.

coryan avatar Apr 05 '23 18:04 coryan