SignalR Hangs

Peter Simard 5 Reputation points
2024-12-17T19:27:48.0966667+00:00

Hi

I have an Azure Web App that hosts a signalr Hub. I have been testing with one client and the app appears to be hanging. The client calls many Signalr operations at one time and I;m not clear if this is causing the app to hang. Can someone explain how SignalR should be configured to allow multiple calls at one time?

Peter

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,963 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 5,405 Reputation points Microsoft External Staff Moderator
    2024-12-19T04:06:39.44+00:00

    Hi @Peter Simard
    Thanks for the question and using MS Q&A platform.

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer

    To allow multiple parallel calls per client in SignalR, set the MaximumParallelInvocationsPerClient property in your Program.cs or Startup.cs during the SignalR setup.
    var builder = WebApplication.CreateBuilder(args);

    // Configure SignalR with MaximumParallelInvocationsPerClient
    builder.Services.AddSignalR(options =>
    {
      options.MaximumParallelInvocationsPerClient = 10; // Allow up to 10 parallel invocations per client
    });
     
    var app = builder.Build();
     
    // Map SignalR hubs
    app.MapHub<MyHub>("/myhub");
     
    app.Run();
    

    references:
    https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.signalr.huboptions.maximumparallelinvocationsperclient?view=aspnetcore-8.0

    Please accept as "Yes" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    2 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.