简体   繁体   English

ASP.NET MVC应用程序身份验证每20-50秒丢失一次

[英]Asp.net mvc application authentication lost every 20-50 seconds

My asp.net mvc application, requires me to login every 20-50 seconds, i contacted the hosting provider, who says its due to recycle of pool. 我的asp.net mvc应用程序要求我每20-50秒登录一次,我联系了托管服务提供商,后者说这是由于回收池造成的。

i have added following code to web.config. 我已将以下代码添加到web.config。

<sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="false" timeout="20"/>

the problem is not solved, how do i serialize the authentication part, suggestions any one. 问题没有解决,我如何序列化身份验证部分,建议任何一个。

Thank you in advance. 先感谢您。

The root of the problem is obviously that the pool is recycling WAY too frequently. 问题的根源显然是池回收WAY的频率太高了。 Did you get any response from the host on what might be causing that? 您是否从主持人收到任何有关可能是什么原因的响应?

Don't band-aid the problem, find the solution to the problem of the app pool recycling. 不要帮忙解决问题,找到解决应用程序池回收问题的解决方案。

To help diagnose your problem, consider: 为了帮助您诊断问题,请考虑:

  • deploying your app locally to a new IIS application. 将您的应用程序本地部署到新的IIS应用程序。 Use all the defaults. 使用所有默认值。 Do the symptoms exist in this setting? 在这种情况下是否存在症状?
  • inspect the settings through whatever user interface your hoster gives you. 通过托管服务商提供的任何用户界面检查设置。 Are there any settings that could've been modified that would cause this? 是否有任何可能被修改的设置会导致这种情况? Here's the default App Pool settings in IIS7 . 这是IIS7中默认应用程序池设置

I agree with p.campbell that their are bigger concerns here with the app pool. 我同意p.campbell的观点,他们对应用程序池的关注更大。 Possible causes of this problem 此问题的可能原因

  • Your hosts are trying to squeeze too many shared hosts onto a single server (and so the server is running out of memory) 您的主机试图将过多的共享主机压缩到单个服务器上(因此服务器内存不足)
  • Your application has outgrown the hosting environment and you should consider a move to dedicated hosting or at least contact your host regarding the possibility of upgrading your app pool. 您的应用程序已经超出了托管环境的范围,因此您应该考虑转移到专用托管,或者至少就升级应用程序池的可能性与托管人联系。
  • Your application has a serious bug in it that is causing the app pool to restart. 您的应用程序中存在一个严重的错误,该错误导致应用程序池重新启动。

Want to narrow it down? 要缩小范围吗? Depending on the issue you may find that enabling ASP.NET health monitoring on the site to log application events to a file/e-mail/SQL server could shed some more light on the matter. 根据问题的不同,您可能会发现,在站点上启用ASP.NET运行状况监视以将应用程序事件记录到文件/电子邮件/ SQL Server可能会进一步说明此问题。

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

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