iiswebsocketsignalrasp.net-core-signalr

Signalr transports - impact on performance, capacity, etc


We are using signalr (.net 8) for some new functionality in our Asp.net core api, consumed primarily by a flutter app.

I implicitly know that, in most cases WebSockets is better that Server-sent-events, which are better than Long-Polling.

Is there any data or tests or whitepapers (anything) that (explicitly) outline the performance impact of the fallbacks.

I want this info to emphasize the importance of having WS support on our servers


Solution

  • You can check out this official SignalR documentation https://learn.microsoft.com/en-us/aspnet/signalr/overview/getting-started/introduction-to-signalr#transports-and-fallbacks ,which clearly states in section Transports and fallbacks that WebSocket is the optimal transport for SignalR. I found some test article and case,you can simply refer to them.

    According to the test results of this Thesis http://www.diva-portal.se/smash/get/diva2:1133465/FULLTEXT01.pdf ,Websockets and Server-sent-events are the most performance efficient.

    And refer to this case WebSockets vs. Server-Sent events/EventSource ,Websockets connections can both send data to the browser and receive data from the browser. SSE connections can only push data to the browser. So, in practice everything that can be done with SSE can also be done with Websockets, and many more browsers support Websockets than SSE.