我正在使用它,它在使用 .NET Framework 4.5 安装了[.NET Framework 4.5] 应用程序SignalR 2.0.0-beta2
的生产环境中表现得很奇怪。AppPool 处于集成模式,只有这个应用程序。ASP.NET MVC 5
Windows Server 2008
IIS 7
发出的GET
请求SignalR
只需要60 毫秒:
http://mysite.org.br/signalr/negotiate?clientProtocol=1.3&_=1374377239338
问题发生在POST
永远需要的请求上。在最近的测试中,它花费了令人难以置信的3m 1s:
http://mysite.org.br/signalr/send?transport=serverSentEvents&connectionToken=Lp%2BGdI6jVTLPrQ3ZGJ065F9GrMbKYWNmgrtKPZz%2BCUYAsxrqP7hyAMPr%2Bg1E3IRY%2F0brzXVanumPy7NPCFOlcXTRrJssFD2EEoxd6fWhAVEUSfIj
当这个间歇性问题发生时,完成请求通常需要40 秒以上。
Firefox 22
用Firebug测试它...如果我禁用浏览器缓存POST
,它运行顺利,也就是说,请求没有延迟。否则,当我启用浏览器缓存时,它会再次延迟POST
请求。
使用Google Chrome 28
POST 时处于待处理状态。
如果我回收了AppPool
,那么POST
请求只需要203 毫秒。我对这个具体做的唯一修改AppPool
是我设置Idle Time-out (minutes) = 0
了,也就是说,我想避免回收AppPool。
看着 Process Explorer,我看到它现在w3wp.exe
已经177.300 KB (Private Bytes)
并且现在。211.900 (Working Set)
CPU
0
这是SignalR
从 Firebug 控制台获取的日志信息:
[00:27:20 GMT-0300] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.3'.
Signal...FCU9MU1 (line 1)
GET http://mysiste.org.br/signalr/negotiate?clientProtocol=1.3&_=1374377239338 200 OK 62ms
js?v=K...xUBM641 (line 1)
[00:27:20 GMT-0300] SignalR: Attempting to connect to SSE endpoint 'http://mysiste.org.br/signalr/connect?transport=serverSentEvents&connectionToken=Lp%2BGdI6jVTLPrQ3ZGJ065F9GrMbKYWNmgrtKPZz%2BCUYAsxrqP7hyAMPr%2Bg1E3IRY%2F0brzXVanumPy7NPCFOlcXTRrJssFD2EEoxd6fWhAVEUSfIj&connectionData=%5B%7B%22name%22%3A%22assessmenthub%22%7D%5D&tid=5'
Signal...FCU9MU1 (line 1)
[00:27:20 GMT-0300] SignalR: EventSource connected
Signal...FCU9MU1 (line 1)
[00:27:20 GMT-0300] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332 and a connection lost timeout of 20000
Signal...FCU9MU1 (line 1)
POST http://mysiste.org.br/signalr/send?transport=s...F0brzXVanumPy7NPCFOlcXTRrJssFD2EEoxd6fWhAVEUSfIj 200 OK 3m 1s
js?v=K...xUBM641 (line 1)
[00:39:12 GMT-0300] SignalR: EventSource readyState: 0
Signal...FCU9MU1 (line 1)
[00:39:12 GMT-0300] SignalR: EventSource reconnecting due to the server connection ending
Signal...FCU9MU1 (line 1)
[00:39:14 GMT-0300] SignalR: EventSource calling close()
Signal...FCU9MU1 (line 1)
[00:39:14 GMT-0300] SignalR: serverSentEvents reconnecting
Signal...FCU9MU1 (line 1)
[00:39:14 GMT-0300] SignalR: Attempting to connect to SSE endpoint 'http://mysiste.org.br/signalr/reconnect?transport=serverSentEvents&connectionToken=Lp%2BGdI6jVTLPrQ3ZGJ065F9GrMbKYWNmgrtKPZz%2BCUYAsxrqP7hyAMPr%2Bg1E3IRY%2F0brzXVanumPy7NPCFOlcXTRrJssFD2EEoxd6fWhAVEUSfIj&connectionData=%5B%7B%22name%22%3A%22assessmenthub%22%7D%5D&messageId=d-k%2C0%7Cx%2C0%7Cy%2C1%7Cz%2C0&tid=5'
Signal...FCU9MU1 (line 1)
[00:39:44 GMT-0300] SignalR: Couldn't reconnect within the configured timeout (30000ms), disconnecting.
Signal...FCU9MU1 (line 1)
[00:39:44 GMT-0300] SignalR: SignalR: Stopping connection.
我Web.config
有这些设置:
<system.web>
.
.
.
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
</providers>
</sessionState>
</system.web>
<system.webServer>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="false" />
<validation validateIntegratedModeConfiguration="false" />
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
<modules runAllManagedModulesForAllRequests="true">
<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor" />
</modules>
<handlers>
<add name="AttributeRouting" path="routes.axd" verb="*" type="AttributeRouting.Web.Logging.LogRoutesHandler, AttributeRouting.Web" />
</handlers>
<security>
<requestFiltering>
<requestLimits maxQueryString="10240"></requestLimits>
</requestFiltering>
</security>
</system.webServer>
从症状看来,响应正在以某种方式被缓冲。此SignalR 问题提到 AVG 防病毒软件是问题所在,但我的客户端服务器上没有安装 AVG 防病毒软件。它有McAfee
。
什么可能导致这种行为?如果您需要更多信息来帮助进一步调试,请询问,我会尽力提供。
注意:与此同时,我恢复到 SignalR 稳定版本 1.1.2,到目前为止一切正常。