gpt4 book ai didi

c# - 实时服务器宕机 有时 asp.net 应用程序,找不到任何原因?

转载 作者:太空狗 更新时间:2023-10-29 23:28:34 24 4
gpt4 key购买 nike

我的 asp.net 应用程序在实时服务器上有时会宕机。所有用户都面临黄色错误屏幕。当我深入研究问题时,我找到了踪迹。

Exception of type 'System.Web.HttpUnhandledException' was thrown. =====>stact trace====> at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.emr_patient_callbacks_patientappointments_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\05f0ecab\db8ea090\App_Web_wgoawcvo.0.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

此异常随机发生,而不是特定位置或特定点击。但是当我在 IIS 上重新启动我的应用程序时,应用程序工作正常。但几个小时后又出现了同样的问题。

最佳答案

仅根据您的堆栈跟踪很难确定地说出任何事情。但这是网站出现故障的一种可能解释。

IIS 有一种称为快速故障保护 的东西,它用来尝试保护自己免受不良应用程序的侵害。当触发Rapid fail protection 时,IIS 会关闭运行错误应用程序的应用程序池。发生这种情况时,即使用户尝试访问应用程序,应用程序池也不会自动启动。只有在 Web 服务器上的管理员手动启动池后,应用程序才会恢复在线。

可以触发快速故障保护 的一件事是应用程序在短时间内反复崩溃。我认为默认值是 5 分钟内崩溃 5 次。

我认为您的应用程序有时会通过在短时间内抛出多个未处理的异常来触发快速故障保护

要解决此问题,您必须对应用程序进行编码,使其不会抛出未处理的异常。向您的 Global.asax 添加一个 Application_Error 处理程序来处理和记录异常(未在其他地方捕获)将是一个好的开始。

关于c# - 实时服务器宕机 有时 asp.net 应用程序,找不到任何原因?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51629921/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com