Closed Bug 1781065 Opened 2 years ago Closed 1 year ago

SignalR connection slowdown multiple tabs

Categories

(Core :: Networking: WebSockets, defect)

Firefox 102
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: jan.seris, Unassigned, NeedInfo)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

Hi there is a bug with SignalR multiple connnections slowing down the more connections the more slowdown.
Please see the following issue and the last comment here:
https://github.com/dotnet/aspnetcore/issues/40453
https://github.com/dotnet/aspnetcore/issues/40453#issuecomment-1194063911

Steve Sanderson is the lead developer of Microsoft SignalR and Blazor team which is a SPA web framework using WebSocket to refresh UI.

Actual results:

Multiple WebSocket connnections slowing down the more connections the more slowdown.

Expected results:

Opening multiple tabs (WebSocket connections) should not heavily increase time needed to establish the connection.

The Bugbug bot thinks this bug should belong to the 'Firefox::Tabbed Browser' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Tabbed Browser

The severity field is not set for this bug.
:dao, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dao+bmo)

Setting the component and waiting for the developer's opinion about it.
If this is not the correct component, please feel free to change it to a more appropriate one. Thanks.

Component: Tabbed Browser → Networking: WebSockets
Product: Firefox → Core

Per discussion in https://github.com/dotnet/aspnetcore/issues/40453#issuecomment-1194063911 this appears to be "by-design"; we're progressively delaying WebSocket connections if the old connections were abnormally ended.
https://bugzilla.mozilla.org/show_bug.cgi?id=711793

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(dao+bmo)
Regressed by: 711793
Flags: needinfo?(jan.seris)

Hi Randell and Valentin.
You say you are progressively delaying WebSocket connections if the old connections were abnormally ended.
This is not the case with the issue I am describing and also in the gif here https://github.com/dotnet/aspnetcore/issues/40453#issuecomment-1194063911 you can see that only new WebSocket connections are added (everytime in a new tab). When approx 5+ are open, it keeps getting very slow. The WebSocket connections are not terminated or abnormally terminated at this moment when only new tabs are added.

Flags: needinfo?(jan.seris)

I also believe that the Blazor framework is freeing the resources associated with the WebSocket connection when a tab is closed (or the browser is closed) because a handler can be placed in the application when a SignalR connection is "ending".

So, this sounds a lot like Bug 782704 - Multiple initiated Websocket connections have an increased delay. The cause of that seems to have been a server that doesn't handle connections asynchronously.
I can't say if that's the problem here, but I tried to reproduce it locally with this code and wasn't able to get the long delays:
https://www.piesocket.com/blog/python-websocket

Jan, could you try to see if you can get it to happen with the same code?
Otherwise, could you provide us with a public server to test this on? Thanks!

Flags: needinfo?(jan.seris)
Keywords: regression
No longer regressed by: 711793
See Also: → 782704, 711793

Closing this bug as there is no response from the author. Feel free to re-open the bug once the requested information from Valentin is available.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.