ASP.NET MVC3中的随机会话超时

时间:2022-03-26 03:26:30

i have an application which gets random session timeouts. (IIS 7.5 on Windows 2008 R2, .NET 4.0)

我有一个应用程序,可以获得随机会话超时。 (Windows 2008 R2,.NET 4.0上的IIS 7.5)

i tried the following:

我尝试了以下内容:

  • checked the application log if the w3wp.exe process was crashed, but there is no entry.
  • 如果w3wp.exe进程崩溃,则检查应用程序日志,但没有条目。

  • disabled in the application pool the rapid fail protection
  • 在应用程序池中禁用快速失败保护

  • moved to the sql server state provider to be sure the loadbalancers sticky session is not the problem. (we use a kemp loadmaster).
  • 移动到sql server状态提供程序,以确保loa​​dbalancers粘性会话不是问题。 (我们使用kemp loadmaster)。

  • ensured that no other applications use the same application pool.
  • 确保没有其他应用程序使用相同的应用程序池。

  • checked that exceptions in a thread of a called assembly is correctly handled. (simulated using throw new exception) and the error handling was correct.
  • 检查是否正确处理了被调用程序集的线程中的异常。 (使用throw new exception模拟)并且错误处理是正确的。

  • ensured that the validationKey and decryptionKey is set in the webconfig on all 4 webservers to the same key.
  • 确保在所有4个Web服务器上的webconfig中将validationKey和decryptionKey设置为相同的密钥。

i run now out of ideas how to spot this evil bug. any suggestions? i cannot reproduce the problem on my local machine in the debugger.

我现在运行的想法如何发现这个邪恶的错误。有什么建议么?我无法在调试器中重现本地计算机上的问题。

one point which is maybe important, the move from page 1 to page 2 where the session loss often happens, takes sometimes more than 120 seconds, because of a third party system which is connected via tcp socket.

可能很重要的一点是,从第1页到第2页的转移经常发生会话丢失,有时超过120秒,因为第三方系统通过tcp套接字连接。

2 个解决方案

#1


7  

HI Snoopy you linked to my question as they are similar,

HI Snoopy你链接到我的问题,因为他们是相似的,

As my appool was crashing I tried this solution. If your appool crash's this may help http://support.microsoft.com/kb/911816

当我的appool崩溃时,我尝试了这个解决方案。如果您的appool崩溃,这可能有助于http://support.microsoft.com/kb/911816

the solution stop fix hack kept my app-pool up but didn't fix the problem,

解决方案停止修复黑客保持我的应用程序池,但没有解决问题,

<configuration>
<runtime>
    <legacyUnhandledExceptionPolicy enabled="true" />
</runtime>

If your app-pool is still intact you might try ELMAH as this helped me a lot http://code.google.com/p/elmah/

如果您的应用程序池仍然完好无损,您可以尝试使用ELMAH,因为这对我有很大帮助http://code.google.com/p/elmah/

you can use this code to get ELMAH to handle unmanaged exceptions http://code.google.com/p/elmah/issues/detail?id=199

您可以使用此代码让ELMAH处理非托管异常http://code.google.com/p/elmah/issues/detail?id=199

I am curious if it is MVC 3.0 problem with .net 4.0 as i have several very similar apps running using MVC 2.0 with no problems, Only started when I moved to MVC 3.0

我很好奇,如果它是.net 4.0的MVC 3.0问题,因为我有几个非常相似的应用程序使用MVC 2.0运行没有问题,只有当我转移到MVC 3.0时才开始

#2


2  

Does it happen on a single server? Sure sounds like an issue with the web-farm.

它是否发生在一台服务器上?当然听起来像网络农场的问题。

Can you alter your app so you don't use the 3rd-party app for testing?

您可以更改您的应用程序,以便不使用第三方应用程序进行测试吗?

You have to eliminate pieces until the failure goes away, then add stuff back. Restore 3rd party app, turn other servers back on, etc.

你必须消除碎片,直到失败消失,然后再添加东西。恢复第三方应用,重新打开其他服务器等。

#1


7  

HI Snoopy you linked to my question as they are similar,

HI Snoopy你链接到我的问题,因为他们是相似的,

As my appool was crashing I tried this solution. If your appool crash's this may help http://support.microsoft.com/kb/911816

当我的appool崩溃时,我尝试了这个解决方案。如果您的appool崩溃,这可能有助于http://support.microsoft.com/kb/911816

the solution stop fix hack kept my app-pool up but didn't fix the problem,

解决方案停止修复黑客保持我的应用程序池,但没有解决问题,

<configuration>
<runtime>
    <legacyUnhandledExceptionPolicy enabled="true" />
</runtime>

If your app-pool is still intact you might try ELMAH as this helped me a lot http://code.google.com/p/elmah/

如果您的应用程序池仍然完好无损,您可以尝试使用ELMAH,因为这对我有很大帮助http://code.google.com/p/elmah/

you can use this code to get ELMAH to handle unmanaged exceptions http://code.google.com/p/elmah/issues/detail?id=199

您可以使用此代码让ELMAH处理非托管异常http://code.google.com/p/elmah/issues/detail?id=199

I am curious if it is MVC 3.0 problem with .net 4.0 as i have several very similar apps running using MVC 2.0 with no problems, Only started when I moved to MVC 3.0

我很好奇,如果它是.net 4.0的MVC 3.0问题,因为我有几个非常相似的应用程序使用MVC 2.0运行没有问题,只有当我转移到MVC 3.0时才开始

#2


2  

Does it happen on a single server? Sure sounds like an issue with the web-farm.

它是否发生在一台服务器上?当然听起来像网络农场的问题。

Can you alter your app so you don't use the 3rd-party app for testing?

您可以更改您的应用程序,以便不使用第三方应用程序进行测试吗?

You have to eliminate pieces until the failure goes away, then add stuff back. Restore 3rd party app, turn other servers back on, etc.

你必须消除碎片,直到失败消失,然后再添加东西。恢复第三方应用,重新打开其他服务器等。