{"id":18525689,"url":"https://github.com/hakobe/grpc-go-client-side-load-balancing-example","last_synced_at":"2025-10-10T02:04:16.203Z","repository":{"id":47484363,"uuid":"128651729","full_name":"hakobe/grpc-go-client-side-load-balancing-example","owner":"hakobe","description":" This is a gRPC client-side load balancing example on top of grpc-go.","archived":false,"fork":false,"pushed_at":"2021-08-30T02:52:21.000Z","size":18,"stargazers_count":16,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T04:14:13.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hakobe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-08T14:51:16.000Z","updated_at":"2023-07-23T05:36:20.000Z","dependencies_parsed_at":"2022-09-08T17:00:57.465Z","dependency_job_id":null,"html_url":"https://github.com/hakobe/grpc-go-client-side-load-balancing-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hakobe/grpc-go-client-side-load-balancing-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakobe%2Fgrpc-go-client-side-load-balancing-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakobe%2Fgrpc-go-client-side-load-balancing-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakobe%2Fgrpc-go-client-side-load-balancing-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakobe%2Fgrpc-go-client-side-load-balancing-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hakobe","download_url":"https://codeload.github.com/hakobe/grpc-go-client-side-load-balancing-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hakobe%2Fgrpc-go-client-side-load-balancing-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002526,"owners_count":26083399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T17:46:42.526Z","updated_at":"2025-10-10T02:04:16.176Z","avatar_url":"https://github.com/hakobe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPC client side load balancing example using Go\n\nThis is a gRPC client-side load balancing example on top of [grpc-go](https://github.com/grpc/grpc-go).\n\nThe only load balancer bundled to grpc-go is `grpc.RoundRobin`. grpc RoundRoubin requires a `grpc.Resolver` which is intended to implement a DNS resolver or an other resourse resolution mechanism like Consul.\n\nIn this example I implemented a `grpc.Resolver` which only returns fixed servers initially passed. It is good for trying gRPC load balancing instantly.\n\n## Prequirements\n\n- [protoc](https://github.com/google/protobuf)\n- [protoc-gen-go](https://github.com/golang/protobuf/tree/master/protoc-gen-go)\n  - `$ go get -u github.com/golang/protobuf/protoc-gen-go`\n\n## Build\n\n```\n$ make\n```\n\n## Run\n\n```console\n# Run 4 servers\n$ ./server/server -hostport 0.0.0.0:5000 \u0026\n$ ./server/server -hostport 0.0.0.0:5001 \u0026\n$ ./server/server -hostport 0.0.0.0:5002 \u0026\n$ ./server/server -hostport 0.0.0.0:5003 \u0026\n\n$ sleep 3 # Wait for server to start up\n\n# Do gRPC method calls 10000 times\n$ time ./client/client -n 10000 \\\n    -server localhost:5000 \\\n    -server localhost:5001 \\\n    -server localhost:5002 \\\n    -server localhost:5003 \\\n \n# or \n$ ./run.sh\n```\n\n# LICENSE\nMIT @hakobe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhakobe%2Fgrpc-go-client-side-load-balancing-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhakobe%2Fgrpc-go-client-side-load-balancing-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhakobe%2Fgrpc-go-client-side-load-balancing-example/lists"}