Azure / azure-signalr

Azure SignalR Service SDK for .NET

Home Page:https://aka.ms/signalr-service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DefaultEndpointRouter results uneven autoscaling in mutiple endpoints scenario

bjqian opened this issue · comments

Describe the Issue

When utilizing two SignalR instances in multiple endpoints scenario:

  • SignalR A: Autoscaling is enabled at 80% of quota usage
  • SignalR B: Autoscaling is enabled at 80% of quota usage

An issue arises after SignalR A is scaled up: SignalR B is less likely to scale up. This occurs because the DefaultEndpointRouter uses a weighted routing method, which routes connections based on the remaining connection quota of each endpoint.

Expected Behavior

The DefaultEndpointRouter should ensure that instances scale more evenly when autoscaling is enabled.

Normalize the DefaultEndpointRouter weight using unit:

private ServiceEndpoint GetEndpointAccordingToWeight(ServiceEndpoint[] availableEndpoints)