You can specify client side round robin load balancing like this:
opts = [("grpc.lb_policy_name", "round_robin",)]
channel = grpc.insecure_channel('<target>:<port>' , opts)
If your target address resolves to multiple addresses then requests are
load balanced in a round robin fashion. Other than pick-first, this is the
only built-in load balancing gRPC client supports
On Sunday, November 1, 2020 at 6:28:53 PM UTC-8 [email protected] wrote:
> Hi Srini Polavarapu
>
> How can I use client side load balancing in Python ?
> Would you please show me some example ?
>
> Thinks !
>
>
> 在2019年2月11日星期一 UTC+8 下午12:02:22<Srini Polavarapu> 写道:
>
>> Since you want to use an in-line load balancer, take a look at NGINX
>> proxy <https://www.nginx.com/blog/nginx-1-13-10-grpc/> that supports
>> gRPC. In such a topology, the DNS points to your LB IP which gRPC clients
>> connects to. LB will then load balance to backends. gRPC client is not
>> aware of how many backends are present since it only talk to the LB in the
>> middle.
>>
>>
>> On Wednesday, February 6, 2019 at 2:50:06 PM UTC-8, [email protected]
>> wrote:
>>>
>>> Hello
>>>
>>> I am exploring Load balancing while using gRPC . So far i have gone
>>> through python quick start guide (hello world example); and it was easy to
>>> follow example. I have the same example running on two of my servers.
>>>
>>> Now I am in search for similar quick start with load balancing. I went
>>> over https://grpc.io/blog/loadbalancing and similar pages which made
>>> sense to me but at the same time i felt overwhelmed and cant figure out
>>> how and where to start.
>>>
>>> I want to start exercising simple code just like python hello world with
>>> load balancing enabled (when client say "hello"; load balancer decides
>>> which server to forward the request and respective server responds with
>>> "world" )
>>>
>>> if you are aware of any such tutorials or reference links please help me
>>> out
>>>
>>> thanks
>>> Ankit
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/f953089a-dd6b-4f1c-847e-272c830467abn%40googlegroups.com.