Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

cloudfoundry-incubator/grpc-throughputlb

Repository files navigation

gRPC Throughput Load Balancer GoDoc travis slack.cloudfoundry.org

The gRPC throughput load balancer is a load balancer that implements the grpc.Balancer interface. It will open a configured number of connections to a single address and not allow more than a given number of concurrent requests per address.

In your code when you make a gRPC request (stream or RPC), the gRPC throughput load balancer will return the connection with the least number of active requests.

Load Balancer Lifecycle

The order gRPC calls methods on the gRPC throughput load balancer are:

  1. Start
  2. Notify
  3. Up
  4. Get

Example

lb := throughputlb.NewThroughputLoadBalancer(100, 20)

conn, err := grpc.Dial(os.Getenv("GRPC_ADDR"),
    grpc.WithBalancer(lb))
if err != nil {
    panic(err)
}

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •