Git Product home page Git Product logo

grpc-envoy-loadbalancer's Introduction

Envoy + gRPC - Basic Load-Balancing

This example used an edge-proxy (frontend/front-envoy) to accept incoming GRPC calls and routes them to a set of backend services which fullfil the requests.

The client creates a single gRPC stub to the edge-proxy and calls stub.SayHelloRequest 10 times. When both helloworld services are up and running each succesive call gets properly load-balanced between the backend services. This is an example of L7 load- balancing of HTTP2 requests.

Quickstart

In one window,

docker-compose up

In another window, run the client:

cd client
docker-compose run --rm client

You can target each of the individual instances on ports 9001 and 9002 respectively.

Example output:

ubuntu@dgx:~/gtc_18/envoy/examples/grpc-proxy/client$ docker-compose run --rm client
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=114c199e6bdb!
ubuntu@dgx:~/gtc_18/envoy/examples/grpc-proxy/client$ ADDRESS=localhost:9001 docker-compose run --rm client
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
Greeter client received: Hello, you from host=ca2310cf3b73!
ubuntu@dgx:~/gtc_18/envoy/examples/grpc-proxy/client$ ADDRESS=localhost:9002 docker-compose run --rm client
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!
Greeter client received: Hello, you from host=114c199e6bdb!

Using EDS

Modify /config/active by commenting out one of the serviceX endpoints. Run ./update.sh the proxy running. This will update the eds.yaml created on startup and trigger an update such that only the hosts in the active file are included in the load-balancing`

Outlier Detection

Added outlier detection to the helloworld cluster. This will drop any endpoint if 5 consecutive 5xx are triggered. For demo purposed, we may need to move that to 1. Hosts will comeback into service when they are alive again on a linearly increasing backoff rate; truly dead hosts/endpoints should be ejected from the EDS list by the active health checker performed by the EDS.

grpc-envoy-loadbalancer's People

Contributors

ryanolson avatar ugodiggi avatar

Watchers

 avatar

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.