IIS应用程序池 - 停止/启动与回收 [英] IIS App Pools - Stop/Start vs Recycle

查看:621
本文介绍了IIS应用程序池 - 停止/启动与回收的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到在我的一个生产网络应用程序中,当我手动回收应用程序池时,基于在任务管理器中观察,回收的工作进程可能需要超过60秒才能实际完全销毁。但是,如果我完全停止应用程序池,工作进程几乎立即消失 - 在1-2秒内。

I've noticed that on one of my production web apps, when I manually recycle an app pool, the recycled worker process can take upwards of 60+ seconds to actually be completely destroyed, based on watching it in Task Manager. However, if I stop the app pool completely, the worker process goes away nearly instantaneously - within 1-2 seconds.

所以,我的问题是双重的:

So, my question is two-fold:

a)当应用程序池被回收而不是停止时,为什么需要这么长时间来销毁进程(更有意义的是,释放它使用/锁定的资源);和

a) Why does it take so long to destroy the process (and more meaningfully, release the resources used/locked by it) when the app pool is recycled instead of stopped; and

b)假设我已经阻止流量被定向到服务器,是否有任何理由不停止/启动而不是回收?

b) Assuming that I've stopped traffic from being directed to the server, is there any reason NOT to stop/start instead of recycle?

编辑


为了澄清,在我回收或停止应用程序池之前,我阻止流量被发送到有问题的服务器(服务器在负载平衡群集中,我从负载均衡器中删除服务器)。因此,理论上,当我对应用程序池做任何事情时,不应该有任何请求进入网站。


To clarify, before I either recycle or stop the app pool, I stop traffic from being sent to the server in question (the server is in a load balanced cluster, and I remove the server from the load balancer). So, in theory, there should be no requests coming to the web site at the time I am doing anything to the app pool.

编辑零件Deux:

阅读Igal的链接后,对我来说似乎很明显发生了什么。当我回收应用程序池时,新进程已启动,但由于根本没有流量,因此它没有将新进程注册为正常运行,因此在超时之前它不会关闭旧进程(即90秒)。

Edit Part Deux:
After reading Igal's link, it seems pretty obvious to me what is happening. When I recycle the app pool, the new process is started, but since there is no traffic at all, it isn't registering the new process as functioning, so it doesn't shut down the old one until the timeout (which is 90 seconds).

根据这些知识,我很清楚回收功能专门用于在实时服务器的中游使用,因为我手动耗尽事先交通,我应该使用停止/开始。

With that knowledge, it's clear to me that the "Recycle" functionality is specifically intended to be used midstream on a live server, and since I am manually draining traffic beforehand, I should use stop/start instead.

推荐答案

a)因为重叠回收。有一段时间旧进程等待新的进程开始。

a) Because of Overlapped Recycling. There is a time period that the "old" process waits for the new one to start.

b)否。据我所知。

这篇关于IIS应用程序池 - 停止/启动与回收的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆