GRPC Connection Management in Golang
问题 I am relatively new to GRPC and want to be sure that I am doing connection management correctly with golang. I don't want to have to create a new connection for every call but I also don't want to create bottlenecks as I scale. What I did was to create a single connection in the init function: var userConn *grpc.ClientConn var userServiceName string func init() { userServiceName := os.Getenv("USER_SERVICE_URL") if userServiceName == "" { userServiceName = "localhost" } logging.LogDebug(