Use `GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL` to create separate gRPC subchannels
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.
I won't have time to work on this.
@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
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).
No time to work on this right now. Closing.