IIS重置和应用程序池回收对缓存的影响有什么区别

发布于 2024-12-17 16:37:30 字数 135 浏览 1 评论 0原文

我遇到了一个奇怪的问题:据我所知,可以通过回收应用程序池来清除缓存。

然而,在最近的一个项目中,缓存并没有以这种方式清除。相反,我们必须重置 IIS 以清除缓存。

这些行为之间有什么区别?造成我所经历的差异的原因可能是什么?

I have encountered a weird problem: as far as I know, cache can be cleared by recycling the application pool.

However, in a recent project, cache is not cleared in that way. Instead we had to reset IIS to clear the cache.

What are the differences between these actions, and what might be the cause of the differences I've experienced?

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

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

发布评论

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

评论(2

哆啦不做梦 2024-12-24 16:37:30

当您回收AppPool时,会有一些重叠时间。您的不健康工作进程被标记为回收,但会继续处理已收到的请求。 (它不会处理新的请求)。一旦处理完所有现有请求,不健康的工作人员将被终止。

IIS 重置后,所有工作线程都会终止,内存中的缓存也会被清除。一旦有新请求进来,就会创建新的工作线程。

所以我认为对于 AppPool 回收和 IIS 重置都会清除缓存。据我所知,该缓存存储在应用程序域中。一旦不健康的工作进程终止,所有缓存项都应该被销毁。

When you recycle the AppPool, there is some overlap time. Your unhealthy worker process is marked for recycling, but continues to handle requests that it has already received. (It will not handle new requests). The unhealthy worker will be terminated once all its existing requests are handled.

With IIS reset, all workers are terminated and the cache in memory is cleared. New workers will be created once new requests come in.

So I think that for both an AppPool recycle and an IIS reset will clear the cache. As for as I know, that cache is stored in the Application domain. Once the unhealthy worker process terminates, all cache items should be destroyed.

无声情话 2024-12-24 16:37:30

详细解释请查看以下文章:
http://fullsocrates.wordpress.com/2012/07/25/iisreset -vs-recycling-application-pools/

简而言之:

回收AppPool功能是在IIS6中引入的。

IISRESET 停止和启动所有 IIS 相关服务。它尝试正常关闭所有组件,即发送关闭请求并等待服务关闭。它等待所有服务关闭,然后再次启动它们。

AppPool 回收首先调用新的工作进程,然后关闭旧的工作进程。这使得停机时间比 IISRESET 更短。

Please check the following article for detailed explanation:
http://fullsocrates.wordpress.com/2012/07/25/iisreset-vs-recycling-application-pools/

In short:

Recycling AppPool feature was introduced in IIS6.

IISRESET stops and starts all IIS related services. It tries to shutdown all components normally i.e. it sends request to shut down and waits for services to shutdown. It waits for all services to shutdown and then starts them back again.

AppPool recycle invokes a new worker process first, and then shutdown the old worker process. This makes the downtime lesser than IISRESET.

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