SignalR: Server doesn't receive any requests i

2019-04-12 23:17发布

Good day.

Background: ASP.NET MVC 3 / SignalR.

I'm developing typical chat component which will be used in a big portal. I wrote small emulator which opens new window with chat component and new SignalR connection in it.

The problem: Everything works fine, but: Suddenly i noticed that if i open more than X windows/tabs with same component in one browser - server stops to receive any responses from any clients connected with it.

The X is:

5 for IE and Chrome

14 for FF.

I suppose it's a browser issue, because the value differs from one to another. Additionally i noticed that requests can stay pending for minutes! And there is no timeout..

Maybe someone faced with something like this, or know what can cause this strange behavior? Thanx in advance, Jan.

标签: signalr
4条回答
孤傲高冷的网名
2楼-- · 2019-04-12 23:55

This is the first post in three days of googling that came close to my experience. I am using the .NET client and have tried isolating the issue by creating an app with just the problem areas. The difference in our situation is this: I don't seem to have some connection limit on the client. In fact, I have no issues until I deploy my .Net hub to the windows server 2008 hyper vps. IIS express runs everything as smooth as butter. I've checked to make sure the asynchronous services and features are running and I've followed the performance tuning articles that david mentions in the documentation, adjusting the setting for thread queue maximums and the like. Note that the minute-two minute delays you describe are identical to mine. I updated to the latest version of SignalR (.4) from nuget and it broke my solution for some reason.

Can you tell me what version you're on? I suspect it could have something to do with security on the physical host where my vps is running. I am going to try it on a different virtualization platform to rule out hyper v issues.

查看更多
迷人小祖宗
3楼-- · 2019-04-13 00:01

Thanx for reply! I just deployed the app to IIS in our server:

Windows Server 2008 SP2 / IIS7

Unfortunately situation is the same. For example Chrome shows me the following picture:

http://clip2net.com/s/1KWF9

Where [1 - 6] - iFrames with chats. Starting from 6th iFrame (or separate browser tab/window - it doesn't metter) communication between clients and server slows down critically. This 6th request actually is finished successfully, but in 2 minutes :). And the next one is executed even longer:

http://clip2net.com/s/1KWGC

I tested this case with another primitive signalR example and got the same thing..

查看更多
何必那么认真
4楼-- · 2019-04-13 00:05

Please, see my answer here: Is there a way to get number of connections in Signalr hub group?

The idea is to overwrite connectionid.

查看更多
5楼-- · 2019-04-13 00:09

I'm going to assume you're using IIS 7/7.5 on windows 7. If you are indeed using Windows7 then you need to use IIS Express since it only supports 10 concurrent connections (Client OS limit). Alternatively you can use Windows Server to get the full benefits of IIS.

查看更多
登录 后发表回答