You should not have to use a separate connection for every RPC call. The `grpc.ClientConn` returned from a call to `grpc.Dial` manages connections to multiple backends under the covers. And even if there are not multiple servers to connect to, each RPC is only a stream, and streams can be multiplexed on a single connection.
Are you sure you are not blocking the main server thread in someway that is not allowing you to serve more than one RPC at a time? On Friday, May 14, 2021 at 1:19:52 PM UTC-7 Asha Prabhakaran wrote: > Hi, > I have a golang GRPC client and a C++ GRPC server providing a synchronous > service. > We have been using a new connection for every RPC call. > When I attempt to use the same connection for multiple concurrent RPC > calls, only one of them succeeds whereas the others keep waiting. > Is it possible to use the same connection for concurrent RPC calls? > > Connection creation: > conn, err := grpc.*Dial*(url, c.opts...) > > For each RPC: > client := pb.*NewXXServer*(conn) > stream, err := client.*GetXX*(lctx, req) > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/802be7bc-2325-4ddd-93a7-5e1c47d57ef0n%40googlegroups.com.
