Haproxy configuration for multiple gprc server is awful and we want to use client-side load balancing but don't know how to do it. I found some files in grpc-node library (like this) related to load balancing, but couldn't find any public api of that. So how can i setup client-side load balancing without using any external service?
Asked
Active
Viewed 29 times
1
-
1Typically you'd use DNS for this: DNS allows multiple `A`/`AAAA` host records to share the same name, so clients would simply pick a host at random - https://www.nginx.com/resources/glossary/dns-load-balancing - or perhaps some tricks with `SRV` records. - this approach also means you don't need to ship a list of known servers in your client software that will always need updating: DNS is a surprisingly capable distributed database with many applications besides resolving `google.com` or whatever. – Dai May 05 '23 at 05:08
-
1Another approach is to to make it _cooperative_ load-balancing: clients would connect to some designated host by-default, but your application's protocol (which may-or-may-not be built-on gRPC) would have a feature whereby the server informs the client it's overloaded and provides a set of alternative hosts for the client to connect to. – Dai May 05 '23 at 05:10
-
1Good reading: https://ieeexplore.ieee.org/document/1015536 – Dai May 05 '23 at 05:11