回收应用程序池对于应用程序到底意味着什么
在属性中,选中了一个复选框,显示“回收工作进程”,该复选框设置为 1740 分钟。
它对我的 ASP.NET 代码到底意味着什么? 静态变量或会话/应用程序变量中的所有内容都会消失吗?
回收对于代码到底意味着什么?
In the properties, there is a checkbox checked that says "Recycle worker processes", which is set to 1740 minutes.
What exactly does it mean to my asp.net code?
Will everything be gone from the static variables or the Session/Application variables?
What exactly does recycle mean to the code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
回收意味着启动一组新的进程来处理池中应用程序的新请求。任何未完成的请求都将正常完成(假设它们不会花费太长时间),此时池的旧进程集将以有序的方式终止。
因此,静态变量值和存储在应用程序对象中的值将丢失,如果会话存储在进程中,则会话值也会丢失。
Recycle means start a new set of processes to handle new requests for applications in the pool. Any outstanding requests will complete normally (assuming they don't take too long) at which point the old set of processes for the pool will terminate in an orderly fashion.
Hence static variable values and values stored in the application object will be lost, also if the session is stored in-proc then the session values are also lost.
IIS 将回收托管您的应用程序的工作进程。这意味着您的 AppDomain、HttpContext、静态变量以及所有内容都将被重置。
编码时始终是一种很好的做法,就好像整个过程可以随时被拆除一样。
IIS will recycle the worker process hosting your app. That means your AppDomain, HttpContext, static variables, everything, will be reset.
It's always good practice to code as if the entire process could be torn down at any time.
回收意味着IIS工作进程将被关闭并启动新的进程。 IE 它将重新启动您的应用程序。这是针对应用程序中卡住线程/内存泄漏的保护措施。
Recycle means that IIS working process will be shutdown and new one will be started. I.E it will restart your application. It is a safeguard vs stuck threads/memory leaks in your application.