GRPC load balancing

I read the load balancing page https://github.com/grpc/grpc/blob/master/doc/load-balancing.md for a start, but still got confused about the correct approach to balancing between the back end instances of GRPC. We are deploying multiple instances of the gRPC microservice and want our other gRPC clients to be able to route between them. We are deploying them as containers in quaternets (actually the Google Container Engine).

Can someone explain the “recommended” approach to balancing gRPC client requests between gRPC servers? It seems that clients should know about endpoints - is it possible to use the built-in LoadBalancer in the container to help?

+4
source share
5 answers

I can’t talk about kubernets, but there are basically two approaches to balancing gRPC:

  • For simple operations, you can enable round robin over the list of addresses returned for a given name (i.e. a list of IP addresses returned for service.foo.com). The way to do this depends on the language. For C ++, you should use grpc::ChannelArguments::SetLoadBalancingPolicyNameround_robin with the argument as an argument (in the future it will also be possible to choose the “ service configuration ”, but the design for how to encode this config in the DNS records is not yet complete).
  • grpclb. . c-ares DNS resolver, # 11237 ( PR ). grpclb open source. :
    • . DNS, , . "", . , , # 11237 .
    • gRPC ( ), . , DNS ( ), grpclb ( server_lists). , , .
    • DNS- . , DNS- . , grpclb. , ? .

, - .

+4

grpc , L4. L7 .

L7?

grpc http2, , . L4 , tcp-, , L7. grpc.

, Linkered/Envoy , .

, nghttpx nghttpx Ingress.

, .

+1

Samarendra

Envoy, Lyft.

HTTP/2 gRPC .

  • L7 gRPC
  • (, )

gRPC gojek, .

+1

Source: https://habr.com/ru/post/1676227/


All Articles