简体   繁体   English

Azure SignalR 自动缩放

[英]Azure SignalR Auto-scaling

I am using Azure SignalR service instance.我正在使用 Azure SignalR 服务实例。 SignalR service currently only supports 1000 concurrent connections per service instance per unit. SignalR 服务目前仅支持每个服务实例每单位 1000 个并发连接。 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.如果并发 SignalR 连接数超过 1000,则必须手动增加服务实例,并随着用户减少而手动减少服务实例。

Looking for a suitable solution to auto-scale (scale up and scale down) the SignalR service instances based on the demand.寻找合适的解决方案来根据需求自动扩展(扩大和缩小)SignalR 服务实例。

If any idea, please share.如果有任何想法,请分享。 Thanks.谢谢。

Azure SignalR service doesn't support any auto-scaling capabilities out of the box. Azure SignalR 服务不支持任何开箱即用的自动缩放功能。

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.常用方法是使用门户、REST API 或 Azure CLI 手动增加单元数量。

They solved the disconnection issue when scaling, according to https://github.com/Azure/azure-signalr/issues/1096#issuecomment-878387639根据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他们正在使用警报和天蓝色功能https://dev.to/wilsonyesidriveracasas/auto-scaling-azure-signalr-units-4e94

Azure SignalR Service supports autoscale as of 2022 if you select premium pricing tear.如果你选择溢价定价,Azure SignalR 服务支持自 2022 年起自动缩放。

  • Go to Scale up on the SignalR Service and select Premium pricing tear.转到 SignalR 服务上的 Scale up 并选择 Premium 定价撕裂。
  • 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).这些示例表明,如果指标“连接配额利用率”超过 70%(第一个单元的 1000 个连接中的大约 700 个),您可以扩大规模。 You can also scale down with a similar rule.您也可以使用类似的规则进行缩小。 The examples says to scale down when the connection quota is under 20%.这些示例说当连接配额低于 20% 时缩小。

20% from the example seems a bit restrictive, but I guess its to avoid unneeded scaling.示例中的 20% 似乎有点限制,但我想它是为了避免不必要的缩放。 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 https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-howto-scale-autoscale

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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