ASP.NET 应用程序启动后立即结束

发布于 2024-09-25 07:53:29 字数 596 浏览 3 评论 0原文

我的托管 ASP.NET 应用程序出现了一些问题。我注意到打开页面时速度很慢,就像您第一次启动 ASP.NET 应用程序时看到的那样。经过研究,我发现 Application_End 事件在应用程序启动后不久就会触发,显然会终止会话、静态值等。

我设置了标准的默认 web.config,并且当页面出现时我正在写入会话被要求。但无论出于何种原因,应用程序在死亡之前都不会等待 20 分钟(或任何默认值)——有时只是一两分钟,有时甚至更短。

当然,这不会在我的开发环境中本地发生 - 一切都按预期工作,具有相同的代码和 web.config 值。

只有一台服务器,所以没有农场或类似的东西。

我知道有很多事情会导致 ASP.NET 应用程序结束 - IIS 重新启动、应用程序池回收、DLL 或配置文件修改、重新启动等。但我希望当我向我的同事报告此情况时能有更好的猜测托管公司,帮助研究和解决问题。服务器没有重新启动,并且我没有修改任何文件,因此这似乎会使 IIS 或应用程序池重新启动,除非我遗漏了其他内容。

IIS 重新启动位于 Windows 事件查看器中,因此很容易找到。假设不是这样,有什么方法可以准确确定应用程序不断重置的原因吗?

如果您对此有任何想法,我们将不胜感激。

Having a bit of a problem with my hosted ASP.NET applications. I noticed slowness when opening pages, the kind of slowness that you see the first time you start up an ASP.NET app. After researching, I'm finding that the Application_End event is firing shortly after the application starts, apparently killing the sessions, static values, etc.

I have the standard default web.config set up, and I am writing to the session when a page is requested. But for whatever reason, the application isn't waiting 20 minutes (or whatever the default is) before dying - sometimes it's just a minute or two, sometimes even less.

Of course, this doesn't happen locally in my dev environment - everything works as expected, with identical code and web.config values.

There is only one server, so no farm or anything like that.

I know that there are many things that cause an ASP.NET app to end - IIS restarting, app pool recycling, DLL or config file modified, reboot, etc. But I'm hoping to have a better guess when I report this to my hosting company, to help research and fix the problem. The server isn't being rebooted, and I'm not modifying any files, so that seems to leave IIS or the app pool restarting, unless I'm missing something else.

IIS restarting is in the Windows Event Viewer, so that's easy enough to find. Assuming that's not it, is there any way to determine exactly why the app keeps resetting?

Any thoughts you may have on this would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

_蜘蛛 2024-10-02 07:53:29

这是您可能会思考和检查的一些原因。

  1. 关闭应用程序的命令。
  2. 导致应用程序崩溃的错误/闭环。
  3. 关闭应用程序的应用程序池的内存限制。 (这是最有可能的)
  4. 共享服务器或虚拟服务器上的 iis 和池配置非常糟糕。也许同一个 iis 上有太多站点,同时池设置也很糟糕?

检查 global.asax 上的错误

void Application_Error(object sender, EventArgs e) 
{
}

您可以通过记录所有错误并检查出来来

。如果您有权访问 iis,您可以检查池设置,或者要求管理员为您检查并删除内存重新启动限制。

This is some of the reason that you may think and check for.

  1. a command that shut-down the app.
  2. a bug/closed loop that crash the app.
  3. a memory limit on the application pool that shut-down the app. (this is the most possible)
  4. a very bad iis and pool configuration on a shared server or on a virtual server. Maybe too many sites on the same iis, and at the same time a bad pool setup ?

You can check for bugs on the global.asax

void Application_Error(object sender, EventArgs e) 
{
}

by log all of them and check them out.

You can check the pool setup if you have access on the iis, or ask from the administrator to check it for you and remove the memory restart limits.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文