grpc / grpc/grpc-dotnet

[question] least connections GRPC load balancing

Open
#2,389 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C#
Stars
4.5k
Forks
836
Avg merge
6d 3h
Merged PRs (30d)
7

Description

I understand that we can create a custom load balancer as per https://learn.microsoft.com/en-us/aspnet/core/grpc/loadbalancing?view=aspnetcore-5.0#create-a-custom-load-balancer.

I want to create a load balancer that sends requests to the endpoint with the least number of currently active connections. With the `SubchannelsLoadBalancer`, I can always know when I am "picking" a given subchannel (and thus I can increment its connection count). Is there any hook that I can call when a given request is completed (so I can decrement connection count)?

I am sure that this type of load balancing will be useful for many people. Perhaps it is worth adding into the library as an out of the box configurable option.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.