There are services calling service A (10 replicas) via GRpc (100+ req/sec), java generated stubs. We don't have load balancers but I am curios what is the best practice in both cases.
Should clients build the channel on each call to service A or Should I create the managedChannel once until the app shutsdown?
If I create one for each request, calls distributes along 10 replicas but if I create only on application starts all calls goes to the same service
Areplica.On the other hand if I create on each call wouldn't there be thousands of connections open until they get idle (which is 30mins by defeault)?
ManagedChannel managedChannel = ManagedChannelBuilder
.forAddress(host, port)
.usePlaintext()
.build()
ServiceA.newBlockingStub(managedChannel)).fooBar(...)