4 ms·
> Either of these approaches defeats a fundamental gRPC benefit: reusable connections. I feel like that's not quite true. The server could notice it's over-wor
by staticassertion 5y ago
> Either of these approaches defeats a fundamental gRPC benefit: reusable connections.
I feel like that's not quite true. The server could notice it's over-worked and start telling clients to back off or otherwise to try another system. At this point the clients can make the call to either back off or terminate the connection. The server can increase its "back off for N ms" until it finally has to
terminate connections.
It requires a bit of extra coordination, but not much.
Also, even without such a system, forcing a reconnect when a new instance starts up/ periodically still reduces connection load a ton. If you force reconnects every minute, and you have 10/rps, that's 1 reconnect per 600 calls.
I guess in theory a load balancer is the most information to make these decisions, so really you'd want it to be aware of 'back off' requests from the server. One way of doing this might be something with health checks? Dunno.