简体   繁体   中英

Azure SignalR Auto-scaling

I am using Azure SignalR service instance. SignalR service currently only supports 1000 concurrent connections per service instance per unit. If the number of concurrent SignalR connections exceed 1000, the service instances will have to be increased manually, and reduced manually as the users decrease.

Looking for a suitable solution to auto-scale (scale up and scale down) the SignalR service instances based on the demand.

If any idea, please share. Thanks.

Azure SignalR service doesn't support any auto-scaling capabilities out of the box.

If you want to automatically increase or decrease the number of units based on the current number of concurrent connections, you will have to implement your own solution. You may for example try to do this using a Logic App as suggested here .

The common approach is otherwise to increase the number of units manually using the portal, the REST API or the Azure CLI.

They solved the disconnection issue when scaling, according to https://github.com/Azure/azure-signalr/issues/1096#issuecomment-878387639

And for the auto-scaling feature they are working on it, and in the mean-time here are 2 ways of doing so:

This post can help you. They are using alerts and azure function https://dev.to/wilsonyesidriveracasas/auto-scaling-azure-signalr-units-4e94

Azure SignalR Service supports autoscale as of 2022 if you select premium pricing tear.

  • Go to Scale up on the SignalR Service and select Premium pricing tear.
  • Go to Scale out and create a custom autoscale.

The examples says that you can scale up if the metric "Connection Quota Utilization" is over 70% (should be about 700 out of your 1000 connections for your first unit). You can also scale down with a similar rule. The examples says to scale down when the connection quota is under 20%.

20% from the example seems a bit restrictive, but I guess its to avoid unneeded scaling. The client connections should be closed and reconnected while scaling down, so doing so very frequently is probably a bad idea.

https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-howto-scale-autoscale

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM