[Blazor][SignalR] Enterprise-grade site with high concurrent traffic

Michel P 21 Reputation points
2022-10-13T15:21:33.127+00:00

Hello,

We have several questions regarding the use of Blazor Server-side and SignalR technologies for a website aiming to reach eventually tens of thousands (perhaps hundreds of thousands occasionaly) of concurrent users.

Here are the list of grey area and unanswered points :
• Is it possible to put the Blazor SignalR hub on one instance of Azure SignalR service, and put all others SignalR hubs of our app in an other Azure SignalR service.
• Is it interesting (and possible) to create a classic web app dedicated to handle SignalR load only.
• How can we approximate the number of messages that an rich UI with grids and buttons and pop-ins will emit for one user performing basic scenario. If it is too unpredictable, is there some tools to find these metrics. (https://learn.microsoft.com/en-us/azure/azure-signalr/signalr-concept-performance, https://github.com/dotnet/aspnetcore/issues/27457)
• We understand that DOM rendering is done server-side, but is there some optimizations done in javascript in order to minimize messages on well-known cases, and is there some patterns or golden rules to follow to minimize messages without sacrificing UI attractiveness.
• Is it really a good choice to go on Azure SignalR service for Blazor Server-side (https://stackoverflow.com/a/60660493)
• Is it wise to use SignalR in Blazor Server-side when an events-based solution could be enough (https://stackoverflow.com/a/69705394)

We would greatly appreciate too to get some names of currently running Blazor Server-side websites with high traffic, to get insights of what could be done.

It seems to be a very attractive stack, with lots of benefits, but the scalability and the costs associated with it when going live appear to be a red flag.

Every feedback will be appreciated.

Best regards,

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,596 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,508 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
147 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,915 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 66,706 Reputation points
    2022-10-13T19:58:59.66+00:00

    with blazor server, the hub is the connection. both the server and the browser are signal/r clients, using the hub to communicate. to scale it makes sense to move the hub to dedicated servers.

    as azure signal/r hubs scale, it your choice to share or use multiple hubs.

    if your blazor server code is also using signal/r to talk to other services, then the dedicated server thread for the blazor app, has multiple signal/r client connections.

    not sure what you mean by web app to handle signal/r load

    you can log the messages for a blazor session. every browser event that your blazor code attaches to, requires the js code to send a signal/r event when that event occurs in the browser. avoid keyboard and mouse events.

    every component render updates the blazor tree (blazer version of the dom). all blazer tree updates must be sent to the browser over signal/r. optimize component re-render. you do this by keeping state as far down the component tree as possible. you don't want to re-render a parent component just to render one of its children.

    if you are scaling blazor server, you need to scale the signal/r hub. azure signal/r has easy scaling, or you build you own. to build your own, you will probably need a load balancer with sticky sessions. to build you own, you probably want the blazor server to host the blazor signal/r hub. the load balancer then then pick blazor/hub server, and the sticky session would allow a reconnect.

    blazor server requires signal/r to talk to the client code in the browser. whether to use signal/r for additional events is your choice.

    the blazor server code is running as long as the user has the app loaded in the browser. if like me, they leave tabs open to sites for days, you server code (thread/state memory) dedicated to that tab will be running for days. if this is an issue, than you will probably need a watchdog timer to shutdown the app.

    blazor server scaling is much more expensive then blazor WASM or a classic web app (even one that uses signal/r).

    0 comments No comments

0 additional answers

Sort by: Most 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.