简体   繁体   English

集线器内的SignalR静态对象使背板重新连接失败

[英]SignalR static objects inside hub makes reconnect fail with backplane

We have implemented a server with backplane where there are more than 100+ clients are connecting. 我们已经实现了带有背板的服务器,其中有100多个客户端正在连接。 But when we were testing it we identified that when ever the clients are getting disconnected none of them are able to reconnect back. 但是,当我们对其进行测试时,我们发现,无论何时客户端断开连接,它们都无法重新连接。 Also we noticed high number of thread usage (more than 5000) by w3wp.exe and then IIS crashes. 此外,我们注意到w3wp.exe大量使用线程(超过5000个),然后IIS崩溃。

In order to identify what is the cause of this we cleaned the hub and what we found was that when the logger class is removed the backplane works perfectly. 为了确定导致此问题的原因,我们清洗了集线器,发现在删除记录器类时,背板可以正常工作。 We have used NLog logger and initiated it as a static logger. 我们已使用NLog记录器并将其启动为静态记录器。

private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();

In order to confirm whether it is problem with NLog we created another static object inside the hub class but that also showed the same high thread usage. 为了确认NLog是否存在问题,我们在hub类内创建了另一个静态对象,但该对象也显示了相同的高线程使用率。 So it seems that whenever there is a static objects clients are unable to reconnect and there is a high usage of threads in the w3wp.exe service. 因此,似乎只要有静态对象,客户端就无法重新连接,并且w3wp.exe服务中的线程使用率很高。 What is the cause for this situation? 造成这种情况的原因是什么?

PS- We tested using both SQL and redis backplane which showed the same exact results. PS-我们使用SQL和Redis背板进行了测试,结果均相同。

问题不是使用集线器内部的静态对象,而是使用NLogTraceListener记录日志信号跟踪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM