Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Config & LoadBalancing Policy #15

Closed
lukaszx0 opened this issue Feb 27, 2017 · 3 comments
Closed

Service Config & LoadBalancing Policy #15

lukaszx0 opened this issue Feb 27, 2017 · 3 comments

Comments

@lukaszx0
Copy link
Contributor

It's not the proposal, but a comment/suggestion to an existing document which predates grpc/proposal - the service config. I thought that the issue here would be the best medium to discuss it.

  // Load balancing policy name.
  // Supported values are 'round_robin' and 'grpclb'.
  // Optional; if unset, the default behavior is pick the first available
  // backend.
  // Note that if the resolver returns only balancer addresses and no
  // backend addresses, gRPC will always use the 'grpclb' policy,
  // regardless of what this field is set to.
  'loadBalancingPolicy': string,

I find loadBalancingPolicy a bit limiting. First of all, it supports only round_robin and grpclb. Secondly, in the case when it's no present, it users the default of pick_first loadbalancer.

This basically makes it impossible to use with custom load balancer implementations that are not based on grpclb.

Could we relax this requirement and allow arbitrary load balancer names as well as change the default? With the default option, I'm suspecting that the documentation might be just confusing and the default won't be pick_first BUT what's statically set in code (eg.: in java if you set managedChannelBuilder.loadBalancerFactory(new Foobar()) it'll be used as a fallback if servic config doesn't specify override).

@markdroth what do you think?

@markdroth
Copy link
Member

The comment saying that the supported values are 'round_robin' and 'grpclb' is just meant to indicate that those are the only two non-default policies that are supported out of the box by the grpc code. The value of this field is a string, and there's no reason it can't be set to whatever value you want. If your clients are built with support for an LB policy called 'foobar', then you can use that string in the service config, and it should work.

The default is indeed to use the pick_first policy. However, @a11r felt that we should not encourage users to explicitly set that, which is why it's not documented as a possible option. However, if you did explicitly set it to that value, I think it should work.

@lukaszx0
Copy link
Contributor Author

I see. Do we want to rephrase that something like:

gRPC supports 'round_robin' and 'grpclb' but custom values are also allowed

I think it's more clear for both readers and implementers.

@mehrdada
Copy link
Member

Looks like this issue is fixed by grpc/grpc#10258. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants