应用程序结束事件后所有会话终止
我们在生产环境中遇到一个奇怪的现象,每隔几个小时,应用程序就会通过 Session_End 事件结束会话并触发 Application_End 事件来踢出所有用户。 在我们的日志中,所有用户的会话都在同一毫秒内关闭。 我们在测试环境中遇到了这个问题,但只是在极少数情况下遇到,而且我们无法重复这个问题。 其他一切看起来都很好,在该服务器上运行的其他应用程序运行良好,没有内存泄漏或 CPU 过度使用。该应用程序基于 ExtJS 3.3 版、NHibnernate 3.2 和 ASP.NET 4.0。 这看起来不像超时错误,一些用户在会话结束前只工作了几分钟。 有人遇到过类似的问题吗?
We are encountering a strange phenomena in our production environment, every few hours the application kicks all users out by ending their sessions with Session_End event and fires Application_End event.
In our log, all the user's sessions are closed on the same mill-second.
We encountered this problem in our Test environment but only on rare occasions, and we could not duplicate this.
Everything else seems fine, other application running on this server works fine, there is no memory leak or CPU overuse. The application is based on ExtJS version 3.3, NHibnernate 3.2 and ASP.NET 4.0.
It doesn't seems like a Timeout error, some of the users worked for only several minutes before the session end.
Has anyone encountered similar problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应用程序池回收(从而结束所有打开的会话并结束应用程序)有几个原因。参见http://blogs.msdn.com/b/johan/archive/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle.aspx以获得完整的概述。
我们曾经在生产环境中遇到过类似的问题。回收的原因是病毒扫描程序在每次扫描时都会触及 web.config,从而导致应用程序池回收。尝试禁用服务器上的病毒扫描程序或排除病毒扫描程序中的应用程序目录。
更改以下文件还将触发应用程序池立即重新启动:
这篇文章: http://weblogs.asp.net/scottgu/archive/2005/12/14/433194。 aspx 为您提供了一种通过更详细的日志记录捕获应用程序结束事件的方法。这可能会帮助您找到回收的原因。
There are a couple of reasons why an application pool recycles (and thus ends all open sessions and ends the application). See http://blogs.msdn.com/b/johan/archive/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle.aspx for a complete overview.
We had a similar problem in a production environment once. The reason for the recycle was the virus scanner that touched the web.config on each scan which made the application pool recycle. Try to disable the virus scanner on the server or exclude the application directory in the virus scanner.
Altering the following files will also trigger an immediate restart of the application pool:
This post: http://weblogs.asp.net/scottgu/archive/2005/12/14/433194.aspx gives you a way to catch the application end event with more detailed logging. This might help you to find the cause of the recycle.