简体   繁体   English

Asp.Net应用程序池重叠的回收时间?

[英]Asp.Net App Pool Overlapped Recycling Timing?

As best I can tell when a worker process recycles: 最好的是,我可以告诉工作进程何时回收:

a) a new one spins up before the old one shuts down b) the old one shuts down once all the active requests its servicing completes a)新的一个在旧的关闭之前旋转起来b)旧的一旦所有活动请求关闭服务就关闭

Is the above accurate? 以上准确吗?

If so, I have data that I store in SQL once Application_End() fires from the global.ascx file. 如果是这样,一旦从global.ascx文件触发Application_End(),我就有存储在SQL中的数据。 I pull this data back in when Application_Start() fires. 我在Application_Start()触发时将这些数据拉回。

The problem is based on my testing, the new worker process fires the Application_Start() before my old worker process gets a chance to complete its Application_End(). 问题基于我的测试,新的工作进程在我的旧工作进程有机会完成其Application_End()之前触发Application_Start()。

What are best practices for handling this situation? 处理这种情况的最佳做法是什么?

cheers in advance 提前欢呼

edit: I just noticed a feature on IIS 7 'Disabled Overlapped Recycle' - I'm guessing this is the best route 编辑:我刚刚注意到IIS 7中的功能“禁用重叠回收”-我猜这是最好的方法

Your description of overlapped recycling is accurate, yes (1); 您对重叠回收的描述是准确的,是的(1); and there is a setting for disabling it, but it's intended to prevent HTTP errors which you would be re-introducing. 并且有一个禁用它的设置,但是它是为了防止您将重新引入的HTTP错误。 App pool recycles are a normal occurrence for managed apps (stems from, among other things, a CLR limitation that prevents the unloading of assemblies in the same memory space) that you must design for. 应用程序池回收是托管应用程序的正常情况(必须阻止(例如,来自CLR限制的词干,该限制防止在同一内存空间中卸载程序集)这是茎),这是您必须设计的。

Your technique would be difficult to manage in a web-farm or web-garden scenario. 网络农场网络花园中,您的技术将难以管理。

I think a better design would be to rely on out-of-process storage for the data (using distributed cache products like ScaleOut, App Fabric, and the like) so that all app pools have the same view of the cached data. 我认为,更好的设计是依靠数据的进程外存储(使用ScaleOut,App Fabric等分布式缓存产品),以便所有应用程序池都具有相同的缓存数据视图。

(1) - http://mvolo.com/blogs/serverside/archive/2008/02/25/Starting_2C00_-stopping-and-recycling-IIS-7.0-Web-sites-and-application-pools.aspx (1) -http://mvolo.com/blogs/serverside/archive/2008/02/25/Starting_2C00_-stopping-and-recycling-IIS-7.0-Web-sites-and-application-pools.aspx

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

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