应如何设置ASP.NET应用程序池自动回收? [英] Should I set ASP.NET application pool to auto-recycle?

查看:995
本文介绍了应如何设置ASP.NET应用程序池自动回收?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有许多信息出现的每个请求中泄漏的内存(少量),ASP.NET(4.0)的Web应用程序。它是这样一个量小,对于大多数使用情况,它不会生长在一时间成为数周或甚至数月的问题。我一般尽量用好关闭应用程序管理的任何连接,避免了状态变量(或实例变量对我单身),等。

I have a number of ASP.NET (4.0) web applications that appear to leak (a small amount) of memory during each request. It is such a small amount, that for most use-cases, it will not grow to become a problem for weeks or even months at a time. I generally try to be good with closing any connections managed by the application, avoiding state-variables (or instance variables for my singleton), etc.

我的问题是 - 是ASP.NET应用程序这是正常的行为呢?我已经关闭了默认值(IIS 7)回收应用程序池20分钟被闲置后的行为。我这样做是因为应用程序需要几分钟的时间来构建其内部缓存,我想避免产生负面影响用户体验(并让他们等待应用程序时,他们发出请求开始)。

My question is this - is this normal behavior for ASP.NET applications? I had turned off the default (IIS 7) behavior of recycling the app pool after 20 minutes of being idle. I do this since the application takes a few minutes to build its internal cache, and I want to avoid negatively impacting the user experience (and having them wait for the application to start when they issue the request).

我知道这可能通过序列缓存或者加快缓存生成过程中得到缓解,但我的问题更多的是与它的原理:我个人认为依靠IIS自动循环功能作为绷带的方法。我错了吗?我只是不上班看到垃圾收集器,因为相比于可用内存量应用程序的内存使用率不够高?或者我应该深入挖掘的内存问题?

I am aware this could be mitigated by serializing the cache or speeding up the cache generation process but my question has more to do with the principle of it: I personally consider relying on the IIS auto-recycle feature as a bandaid approach. Am I wrong? am I just not seeing the garbage collector at work because the application's memory usage is not high enough compared to the amount of available memory? or should I dig deeper into the memory issues?

任何有识之士将AP preciated。

Any insight would be appreciated.

推荐答案

不幸的是它的的正常,虽然大多会费伪劣应用程序编写者比什么都重要。

Unfortunately it is normal, though mostly dues to shoddy application writers than anything else.

IIS默认配置了新创建的应用程序池每1740分钟回收这个原因。

IIS by default configures newly created application pools to recycle every 1740 minutes for this reason.

正如你所说,这是一个创可贴。这清除了所有的资源(包括晃来晃去的事件处理程序)的井书面申请,应不漏气的。

As you said, this is a band-aid. A well written application that clears up all of its resources (including dangling event handlers), shouldn't leak at all.

请参阅博客文章的主题。

See this blog post about the subject.

这篇关于应如何设置ASP.NET应用程序池自动回收?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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