9

TL;DR : I did not read the fucking manual.

Story :

We have a particular kind of setup with Blazor Server-side. And it does not use any SQL, bbut calls APIs.

The class to call APIs was scoped to create one new HTTP connection per new tab (even if the user opens a new tab, it's a new HttpClient).

We were fine. I read that we have 65k ports and disposal takes around 2 minutes, and we have around 1000 users. So it went into the "backlog, where things go to die."

Hard core duiscovery in the past 2 days.

Azure service plan for webapps only allows you 128 outbound connections!

System, we reboot it manually every 4 hours, while I'm working to make HttpClient unique lol

I just needed a break and vent. And "Hey kids, know that Azure service plan is only 128 sockets, not 65536."

Comments
  • 1
    Did someone notice?
  • 2
    What the heck this sounds weird! Wish I could see your code so I can understand.
  • 1
    @Chewbanacas Oh yes, lol. When you just get a white page, you F5, still a white page, well, you notice.

    Except for users who, by chance, were on a non-loaded server, and they were like, "Everything is fine!"
  • 1
    @retoor Outbound yes, but not "calls."

    Connections.

    So when a user connects to the platform, there is 1 connection created from the platform to the API server (I simplify a bit). During this user's usage (any API calls), everything goes through this 1 channel.

    The limit was 128 channels opened, not 128 parallel requests.

    The RIGHT solution is " Only have 1 chanel for ALL connected users.
  • 1
    @iSwimInTheC Brief version, very simplified:

    `services.AddScoped<HttpClient>()`

    Vs what it SHOULD BE:

    `services.AddSingleton<HttpClient>()`
  • 0
    @retoor Ok, I simplified a lot.

    ‘Connection’ in this context is an outbound SNAT connection, which is different from opening a socket.

    SD, even if our “blazor” server and “ApiServer” are both living inside the same Azure subscription, they use outside connection, which is limited.

    More info:

    https://learn.microsoft.com/en-us/...
  • 1
    Did they fix it?

    Edi: Can't upload images anymore lol

    Went from 128 SNAT to... 0.5 !
Add Comment