4

I am a bit confused with the Azure SignalR connection count. When I run my MVC.NET on my Visual Studio debug mode, it immediately creates 10 server connections. So, I carefully looked at the documentation (https://learn.microsoft.com/en-us/azure/azure-signalr/signalr-concept-messages-and-connections) and it said that

By default, each application server starts with five initial connections per hub, and each client has one client connection.

For example, assume that you have two application servers and you define five hubs in code. The server connection count will be 50: 2 app servers * 5 hubs * 5 connections per hub.

Well using the formula above, I should only have 5 connections because: 1 app server * 1 hub * 5 connections per hub = 5 connections. I can't understand why my portal showed that I have 10 server connections instead of 5.

Can anyone help to explain how Azure calculates the server connection?

Thanks...


UPDATE

For those who looking on how to enable Live Trace Tools:

  1. Go to SignalR
  2. Click on the SignalR that you want to trace
  3. Click on Monitoring | Diagnostic Settings
  4. If you haven't configure your log, click on "Configure Log Destination Settings" (Note: I think the cheapest way is to store under your storage account with retention of 1 day).
  5. Tick Enable Live Trace and click Save
  6. Open Live Trace Tool (it should say "Connected" on the top right corner)
  7. Click on Capture
  8. Start your app

Live Trace Tool

Sam
  • 1,826
  • 26
  • 58
  • @sam-can you verify your code to make sure ConnectionCount (part of configure service options) is set to default value (5). Refer https://github.com/Azure/azure-signalr/blob/dev/docs/run-asp-net-core.md#connectioncount I am suspecting the value is set to "10", that's why you are seeing 10 server connections. – RKM Jun 24 '21 at 13:17
  • Hi @RajkumarMamidiChettu-MT, I only put it in the Web.config. Here is the connection string ``. I do not specify the **ConnectionCount**. Any idea? – Sam Jun 25 '21 at 00:18

1 Answers1

1

Go to Diagnostics Settings under Monitoring tab in Azure portal SignalR service. Click on "Open Live Trace Tool" button. Click on Capture in newly opened window. When you run your application, all connections would be shown in Live Trace.

  • Hi Hovsep, when I called `app.MapAzureSignalR("1_TestWebsite")`, it actually create the hub `1_testwebsite`. Any idea to prevent `1_testwebsite` hub to be created? I just need `testnotifyhub` which is defined using hub class: `public class TestNotifyHub : Hub` – Sam Jun 29 '21 at 03:31