General Performance Question

Looking for feedback from anyone who's implemented Blazor Server-Side. My testers are currently seeing a lot of disconnects when the app is up on an Azure server. What are the best practices to keeping an application from timing out? My end users will be using the application all day long and I don't want them to have to log back in over and over again. And I definitely don't want them to have to reload a page they were working on because they had left it untouched for 10/20 minutes before coming back to it. How can I prevent this from happening?

Hi @kgordon,

This is the default Blazor behavior - this message is displayed when the underlying SignalR "circuit" is closed for whatever reason. More information is available here. I don't think this can be fixed in any way because it seems to be "by design". Some people suggest to hide the reconnection overlay but I am not sure if this is a good solution and this is why Radzen does not implement it. Others suggest to reload the page when a disconnect happens.

@korchev Any thoughts on ways to keep this SignalR circuit open? That's what's most important to me. Cause reloading a page after a disconnect will lose the work they were doing and that's what I want to avoid. My application isn't going to have a massive number of end users. Max of 30. But it is critical that they don't lose connection.

I am not aware of any ways to keep the SignalR circuit open. I think it is by design that connections are recycled. However the circuit shouldn't close if the internet connection of your user is stable and the page is actively used. One thing that Microsoft recommend is using Azure SignalR. We haven't used it ourselves though and don't know if it will help or not.

Yeah it's the page is actively used part that's tricky for me. There will be times that the user will working on the app, but then they'll get a phone call or have to answer email, etc, but the app will still be open. They need to be able to continue where they left off once they come back to the application. Thanks for the feedback, I'm looking into this further, if anyone has any ideas on how to handle this, particularly in an Azure setting, that would be greatly appreciated.

Maybe increasing the ClientTimeoutInterval and/or KeepAliveInterval would help.

     services.AddServerSideBlazor().AddHubOptions(o =>
        {
            o.ClientTimeoutInterval = TimeSpan.FromMinutes(60);
            o.KeepAliveInterval = TimeSpan.FromMinutes(60);
        });

This code should be added in a partial class for the Startup in the OnConfigureServices partial method.

3 Likes