ASP.NET 中的应用程序生命周期
这应该是一个简单的问题,但我还没有在谷歌上找到答案。
我想知道,用白痴都能理解的术语来说,应用程序生命周期在 ASP.NET 中到底意味着什么(以及因此您何时可以期望应用程序启动和结束事件运行)。
我认为这会发生在您在 IIS 中运行和停止应用程序时,但我读到的内容表明它与请求数量有关。
This should be a simple question but I haven't managed to find the answer on google.
I would like to know, in terms an idiot can understand, exactly what application lifetime means in ASP.NET (and therefore when you can expect application start and end events to run).
I assumed it would be when you run and stop the app in IIS, but I've read things that suggest it's related to number of requests.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须考虑如何配置您的站点运行的应用程序池。应用程序可以与其他应用程序一起转储到一个池中,也可以拥有自己的应用程序。池可以根据超出某个点的内存使用情况重新启动,可以说是通过计时器(例如每天凌晨 3 点重置),而且我相信是通过超出某个可配置数量的请求数量来重新启动。不是 IIS 的超级专家,因此购买前请先验证;-)
You do have to consider how the Application Pool that your site is running in is configured. Applications can be dumped in a pool with other apps or it can have its own. The pool can be restarted based on memory usage beyond a certain point, by a timer so to speak (reset daily at 3am for example) and I believe by a number of requests beyond a certain configurable number. Not a super expert on IIS so verify before you buy ;-)
默认情况下,生命周期从对应用程序的第一个请求开始。它会在空闲超时后结束。
但这是可以根据 IIS 中的各种情况(包括请求计数)进行配置的。
并且IIS7.5具有在IIS启动时启动应用程序的能力,而不是等待第一个请求。
By default the lifetime starts with the first request to the app. And it ends after an idle timeout.
But this is configurable based on various things (including request count) in IIS.
And IIS7.5 has the ability to start an application when IIS starts, rather than waiting for the first request.