4 ms·
>the clients know how to do load balancing that is of course true, but they won't be able to ommit not working/failed/overloaded nodes whereas a load balancer
by mr__y 7y ago
>the clients know how to do load balancing
that is of course true, but they won't be able to ommit not working/failed/overloaded nodes whereas a load balancer might be able to do so. On the other hand the client might be programmed to just use another IP from the list and resend request if one node fails to answer, but this would increase the total time required by the client to do a successful connection.
I also realise that non-responsing nodes might be rare enough for this to be a negligible problem - just playing devils advocate here.
- jrockway 7y agoNo you can do all that stuff with grpc. You can use active health checks (grpc.health.v1) to add or remove nodes from the pool. (You can configure the algorithm that is used to select a healthy channel for the next request, too.) You can also talk to a central load balancer, which provides your client with a list of endpoints it's allowed to talk to. When you control the client, you don't have to resort to L3 hacks to distribute load. You can just tell the client which replicas are healthy. (And both ends can report back to give the central load balancer information on whether or not the supposed healthy endpoints actually are.) L3 load balancing actually works somewhat poorly for HTTP/2 and gRPC anyway. They only balance TCP connections, but you really want to balance requests. That is why people have proxies like Envoy in the middle; the client isn't smart enough to be able to do that, but it is. But if you control the client, you can skip all that and do the right thing with very little resources.
- namibj 7y agoIf your nodes are large enough, you won't need to balance requests directly. You do need it to work on 5~50 requests in parallel, however.