IIS can only support three instances of a Blazor server client?

Viewed 140

I've download Visual Studio 2022 and tested the default Blazor Server template (Home/Counter/FetchData). In Visual Studio, IIS Express I can open as many tabs / instances of the application as I want.

When I host the default Blazor Server template in local IIS (Windows 10 Home 21H2, IIS 10) I can only open three instance of the application. The fourth will hang until the first is closed. I see someone has ran into nearly the exact same issue but there is no solution provided.

Anyone know whats going on? I don't understand why IIS Express can handle multiple instnaces but IIS 10 can not. Even Conveyor by Keyoti can support many many tabs compared to IIS 10.

Note: I notice SignalR has limitations on Windows / IIS of 10 concurrent connections, but I'm not even getting two.

Updates

  • Out of curiosity I tested it on Windows Server 2016 Standard and I can open hundreds of tabs.

  • I re-installed IIS on Windows 10 to make sure something wasn't wacky.

  • I've ensured WebSocket Protocol is enabled.

3 Answers

Windows 10 Home supports 3 concurrent connections at the same time, according to Microsoft.

Normal HTTP requests to IIS get process and response returned. So even if you manage to achieve 4 or more at the same time, IIS will work through the request queue and you may not have noticed that your request was slightly delayed unless your individual requests take a while to process.

However with SignalR, a persistent connection is maintained to the server. So if you open one connection per browser tab, and you have 4 tabs open, that 4th tab is going to hang indefinitely until one of the other page has its connection ended (by closing the tab, manually disconnecting via code, or refreshing the page).

I can't reproduce the issue, and I have tried to search some way to solve it.I will summarize a few ways below that you can try.

  1. Try to install Websocket Protocol in your Win10. You can find it in Windows features.

    enter image description here

  2. Workaround: install IIS Express in Web Platform Installer.

  3. Workaround: Try to deploy it in windows server, and check whether have same issue. I found some posts also mentioned it may related with OS version.

The solution was incredibly simple (maybe too simple?). Don't use IIS at all.

  • In Program.cs just before building the app I override Kestrel ports to listen on any ip (for now).
  • (Optional) I provide a custom SSL certificate in the UseHttps constructor so that it can be emailed and installed on iOS and Android devices.
  • (Required) Then I publish the applications to a folder and just run the .exe on the hosting machines.

Program.cs

builder.WebHost.ConfigureKestrel(opt =>
{
    opt.ListenAnyIP(8000);
    opt.ListenAnyIP(8001, listOpt =>
    {
        listOpt.UseHttps(@"Path to.pfx file", "password for pfx file");
    });
});

Now Windows 10 Home can support as many connections as the hardware can handle at https://192.168.0.XXX:8001. Is this how Blazor Server is expected to be deployed within a local network? I don't understand how this overcomes the connection limit pointed out in masons answer. Please let me know in the comments if I'm missing something.

Related