admin管理员组文章数量:1402829
I have an asp core signlar application which essentially consumes messagages from a rabbitmq server and "broadcasts" them to all "connected" clients using signalr, i.e.:
var start = Stopwatch.GetTimestamp();
await hubContext.Clients.All.SendCoreAsync("NewMessage", [message]);
Console.WriteLine(Stopwatch.GetElapsedTime(start));
What I notice is that this can take anywhere from less than 1 second...to upwards of 10 minutes.
Our application does push quite a lot of messagse to clients...so I assume what's happening is that some clients are unable to keep up (perhaps due to insufficent network bandwidth) or even that they've been disconnected...but signarlr still thinks they are connected.
However, the docs for this method say that this method:
Does not wait for a response from the receiver.
However, this comment on a related dotnet github issue is a bit ambiguous
In general, a slow client should not affect when the SendAsync completes. However, if there's a long backlog of messages waiting for a single client and the client has disconnected (and is thus not recieving them), then you can end up blocked.
Is there someway I can see if there are a 'backlog of messages waiting for a single client'?
How can I prevent a 'dodgy' client from negatively impacting the performance for all users? Should i simply not await this method?
本文标签: performanceHow does IHubClientsSendCoreAsync behave when a client is slowdiscconnectedStack Overflow
版权声明:本文标题:performance - How does IHubClients.SendCoreAsync behave when a client is slowdiscconnected? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744348590a2601914.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论