Uredi

Deli z drugimi prek


How to scale an Azure SignalR Service instance?

This article shows you how to scale your instance of Azure SignalR Service. There are two scenarios for scaling, scale up and scale out.

  • Scale up: Get more units, connections, messages, and more. You scale up by changing the pricing tier from Free to Standard.
  • Scale out: Increase the number of SignalR units. You can scale out to as many as 100 units. There are limited unit options to select for the scaling: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90 and 100 units for a single SignalR Service instance. If you want to scale beyond 100 units, the Premium_P2 SKU offers expanded capabilities.

The scale settings take a few minutes to apply. In rare cases, it may take around 30 minutes to apply. Scaling doesn't require you to change your code or redeploy your server application.

For information about the pricing and capacities of individual SignalR Service, see Azure SignalR Service Pricing Details.

Note

Changing SignalR Service from Free tier to Standard or Premium tier or vice versa, the public service IP will be changed and it usually takes 30-60 minutes to propagate the change to DNS servers across the entire internet. Your service might be unreachable before DNS gets updated. Generally it’s not recommended to change your pricing tier too often.

Scale Up on Azure portal

  1. In your browser, open the Azure portal.

  2. In your SignalR Service page, from the left menu, select Scale Up.

  3. Click Change and select Standard Tier in the pop out blade.

    Screenshot of scaling up on Portal.

  4. Select Save.

Scale Out on Azure portal

  1. In your browser, open the Azure portal.

  2. In your SignalR Service page, from the left menu, select Scale Out.

  3. Choose the unit in the Manual scale sector.

    Screenshot of scaling out on Portal.

  4. Select Save.

Scale using Azure CLI

This script creates a new SignalR Service resource of Free Tier and a new resource group, and scales it up to Standard Tier.

#!/bin/bash

# Generate a unique suffix for the service name
let randomNum=$RANDOM*$RANDOM

# Generate a unique service and group name with the suffix
SignalRName=SignalRTestSvc$randomNum
#resource name must be lowercase
mySignalRSvcName=${SignalRName,,}
myResourceGroupName=$SignalRName"Group"

# Create resource group 
az group create --name $myResourceGroupName --location eastus

# Create the Azure SignalR Service resource
az signalr create \
  --name $mySignalRSvcName \
  --resource-group $myResourceGroupName \
  --sku Free_F1 \
  --service-mode Default

# Scale up to Standard Tier, and scale out to 50 units
az signalr update \
  --name $mySignalRSvcName \
  --resource-group $myResourceGroupName \
  --sku Standard_S1 \
  --unit-count 50

Make a note of the actual name generated for the new resource group. You'll use that resource group name when you want to delete all group resources.

Clean up deployment

After the sample script has been run, the following command can be used to remove the resource group and all resources associated with it.

az group delete --name myResourceGroup

Compare pricing tiers

For detailed information, such as included messages and connections for each pricing tier, see SignalR Service Pricing Details.

For a table of service limits, quotas, and constraints in each tier, see SignalR Service limits.

Enhanced Large Instance Support with Premium_P2 SKU

The new Premium_P2 SKU is designed to facilitate extensive scalability for high-demand scenarios. This SKU allows scaling among 100, 200, 300, 400, 500, 600. 700, 800, 900, 1000 units for a single SignalR Service instance. This enhancement enables the handling of up to one million concurrent connections, catering to large-scale, real-time communication needs.

You can scale up the SKU to Premium_P2 using Azure portal or Azure CLI.

The Premium_P2 tier uses a different architecture internally to manage a large amount of underlying resources. Thus, it's expected that scaling operations of this tier might take longer compared to those in smaller SKUs.

Note

Be aware that there is a default quota limit capping the number of SignalR units at 150 per subscription per region. This is a soft limit and can be increased upon request. To do so, simply submit a support ticket to request an adjustment to this quota.

Next steps

In this guide, you learned about how to scale single SignalR Service instance.

Autoscale is supported in Azure SignalR Service Premium Tier.

Multiple endpoints are also supported for scaling, sharding, and cross-region scenarios.