Code Monkey home page Code Monkey logo

grpclb's Introduction

grpclb

Build Status GoDoc Gem Version License

External Load Balancing Service solution for gRPC written in Go. The approach follows the proposal outlined by the core gRPC team.

grpclb load-balancer provides a neutral API which can be integrated with various service discovery frameworks. An example service discovery implementation is provided for Consul.

Usage

Load Balancer

Please also see the bootstrap for Consul backed load-balancers as a reference for building load balancers. Either use the command directly or build your very own.

Server

Servers can optionally report load to the Load Balancer. An example:

See Documentation

Client

See Documentation

grpclb's People

Contributors

dependabot[bot] avatar dim avatar edbaunton avatar flisky avatar mxmcherry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grpclb's Issues

Forget balancer backend on errors?

Faced the following problem when using grpc-lb-consul:

  • gRPC service runs on some HOST:PORT
  • then it exits
  • another (HTTP/1) service starts on same HOST:PORT (really rare case, but it happened with me)
  • balancer continues to query that HOST:PORT (with new HTTP/1 service running) and logs many errors:
error retrieving load score for EXITED_GRPC_SERVICE from HOST:PORT: rpc error: code = 13 desc = transport is closing

It's logged here: balancer/backend.go#L79

New HTTP/1 service receives HTTP/2 PRI method requests (which it cannot process; but even if it could - another error would be returned - like "no such endpoint" or similar).

My suggestion is to close backend on errors (probably, only on some specific errors - like "closing" or similar) and exclude it from a set of backends for service.

Backends are re-discovered (so closed/connected) each balancer.Config.Discovery.Interval (defaults to 5m).

So even if there is no new service, running on that HOST:PORT, grpc-lb-consul may flood the logs with some other errors (like "couldn't connect" or so).

So "self-closing" backends would be nice to have.


Also, probably, health/load checks would be better done with gRPC streams? Not that it's very important, but if another gRPC service "reuses" address, it may be reported to "previous" service client while services are not re-discovered. But this is rare case, so, probably, not worth bothering.

No working grpc-lb-server

There's no working grpc-lb-server to illustrate how to work with grpc-lb-client and grpc-lb-consul.

grpc-lb-client fails to run

I am running the grpc-lb-consul and the grpc-lb-client cmds together with consul.

When the client executes the call to "Servers" at

resp, err := bc.Servers(context.Background(), &balancerpb.ServersRequest{

it cancels the connection and stops.

FATAL rpc error: code = Internal desc = rpc error: code = Unavailable desc = grpc: the connection is unavailable

I debugged the problem and found, that the call to "Load" in order to update the score
https://github.com/bsm/grpclb/blob/master/balancer/backend.go#L63
fails.

I am not sure why the grpc-lb-client does not work but I assume, that the new balancer
created at https://github.com/bsm/grpclb/blob/master/cmd/grpc-lb-consul/main.go#L41 considers load reporting if nil configuration is used (and thus default applied)?

How is this supposed to work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.