在共享环境中的IIS7中回收应用程序池的最佳设置是什么?

时间:2022-10-02 22:57:44

What are optimal settings for Recycling of Application Pools in IIS7 in a shared environment?

在共享环境中回收IIS7中的应用程序池的最佳设置是什么?

在共享环境中的IIS7中回收应用程序池的最佳设置是什么?

4 个解决方案

#1


34  

As a Hoster, you definitely want to recycle on Memory & Time, potentially Request limits and CPU. You want to be pretty aggressive about these limits, but make sure you publish them to your clients.

作为Hoster,您肯定希望在内存和时间上回收,可能是请求限制和CPU。您希望对这些限制非常积极,但请确保将它们发布给您的客户。

Memory - 512 for an x86 box, maybe 768. For x64, you can set this much higher depending on the number of hosts per server. You just have to be careful and watch your app pool recycle events on memory issues.

内存 - 对于x86机箱512,可能是768.对于x64,您可以根据每台服务器的主机数量将其设置得更高。您只需要小心并在内存问题上观看您的应用程序池回收事件。

Time - We typically recycle at 1 am in the morning, plus or minus (first site 1:01, second 1:11, third 1:21, just so you don't have all recycling at the same time)

时间 - 我们通常在早上1点回收,加或减(第一个站点1:01,第二个1:11,第三个1:21,因此您没有同时进行所有回收)

Request limit - 35,000 was the default for IIS6, but this number is quite arbitrary, and very dependant on the site in question. For small usage sites, the nightly recycle will hit long before you get 35k requests.

请求限制 - 35,000是IIS6的默认值,但这个数字非常随意,并且非常依赖于相关网站。对于小型使用场所,夜间回收将在您获得35k请求之前很长时间。

CPU - 95%/1 minute limit/KillW3WP, but use this carefully. My understanding of this is that if the CPU hits 95%+ over the 1 minute limit for this worker process, the worker process gets killed and is unable to restart for the remainder of the limit when Action is set to KillW3WP. You might want to try NoAction initially and just watch your event logs carefully.

CPU - 95%/ 1分钟限制/ KillW3WP,但要小心使用。我对此的理解是,如果CPU在此工作进程的1分钟限制内达到95%以上,则当Action设置为KillW3WP时,工作进程将被终止,并且无法在剩余的限制内重新启动。您可能希望最初尝试NoAction,并仔细查看您的事件日志。

Recycle Event Logs - You want to make sure you are logging app pool recycles for each event threshhold that you set - i.e. if you limit based off of requests limits, make sure that Request Limit logging is enabled.

回收事件日志 - 您希望确保为所设置的每个事件阈值记录应用程序池回收 - 即,如果基于请求限制进行限制,请确保启用了请求限制日志记录。

One thing to remember is that you should set retail="true" in the <deployment> element in your machine.config:

要记住的一件事是你应该在machine.config的 元素中设置retail =“true”:

<system.web>
    <!--
        <deployment
            retail = "false" [true|false]
        />
    -->
    <deployment retail="true" />
</system.web>

Not setting this will allow a site to turn debugging on, which allows unlimited timeouts in requests - not exactly ideal for a hoster...

不设置这将允许站点打开调试,这允许在请求中无限制超时 - 不完全适合于主机...

#2


2  

If you have a heavy traffic site, use long recycle schedule. If you have a low traffic site use shorter/default schedule to save memory.

如果您有繁忙的交通站点,请使用长时间的回收计划。如果您的流量较低,则使用较短/默认计划来节省内存。

I learned this from Al Zabir's blog: http://msmvps.com/blogs/omar/archive/2008/10/04/best-practices-for-creating-websites-in-iis-6-0.aspx

我从Al Zabir的博客中了解到这一点:http://msmvps.com/blogs/omar/archive/2008/10/04/best-practices-for-creating-websites-in-iis-6-0.aspx

Daniel S. is right, your session variables get destroyed on recycle, so make sure you test this well or have good error protection/recovery when getting your session objects.

Daniel S.是对的,您的会话变量在回收时会被破坏,因此请确保在获取会话对象时对此进行良好测试或具有良好的错误保护/恢复。

#3


1  

Tip: When you recycle your app, all your session variables are destroyed... so caution on this!

提示:当您回收应用程序时,所有会话变量都会被销毁...所以请注意这一点!

IMHO, keep the defaults.

恕我直言,保持默认值。

#4


1  

you need to cater the settings to your needs, take into account the amount of memory you have and the peak times of usage for your site/web application.

您需要根据需要满足设置需求,并考虑您拥有的内存量以及站点/ Web应用程序的高峰使用时间。

Also take into account the memory usage of your site/web application as if there are memory leaks you might be recycling more often then you think.

还要考虑您的站点/ Web应用程序的内存使用情况,就好像存在内存泄漏一样,您可能会更频繁地回收,然后您会想到。

Weigh up any leaks against the cost of recycling, as stated above you will lose state variables.

根据回收成本计算任何泄漏,如上所述,您将丢失状态变量。

#1


34  

As a Hoster, you definitely want to recycle on Memory & Time, potentially Request limits and CPU. You want to be pretty aggressive about these limits, but make sure you publish them to your clients.

作为Hoster,您肯定希望在内存和时间上回收,可能是请求限制和CPU。您希望对这些限制非常积极,但请确保将它们发布给您的客户。

Memory - 512 for an x86 box, maybe 768. For x64, you can set this much higher depending on the number of hosts per server. You just have to be careful and watch your app pool recycle events on memory issues.

内存 - 对于x86机箱512,可能是768.对于x64,您可以根据每台服务器的主机数量将其设置得更高。您只需要小心并在内存问题上观看您的应用程序池回收事件。

Time - We typically recycle at 1 am in the morning, plus or minus (first site 1:01, second 1:11, third 1:21, just so you don't have all recycling at the same time)

时间 - 我们通常在早上1点回收,加或减(第一个站点1:01,第二个1:11,第三个1:21,因此您没有同时进行所有回收)

Request limit - 35,000 was the default for IIS6, but this number is quite arbitrary, and very dependant on the site in question. For small usage sites, the nightly recycle will hit long before you get 35k requests.

请求限制 - 35,000是IIS6的默认值,但这个数字非常随意,并且非常依赖于相关网站。对于小型使用场所,夜间回收将在您获得35k请求之前很长时间。

CPU - 95%/1 minute limit/KillW3WP, but use this carefully. My understanding of this is that if the CPU hits 95%+ over the 1 minute limit for this worker process, the worker process gets killed and is unable to restart for the remainder of the limit when Action is set to KillW3WP. You might want to try NoAction initially and just watch your event logs carefully.

CPU - 95%/ 1分钟限制/ KillW3WP,但要小心使用。我对此的理解是,如果CPU在此工作进程的1分钟限制内达到95%以上,则当Action设置为KillW3WP时,工作进程将被终止,并且无法在剩余的限制内重新启动。您可能希望最初尝试NoAction,并仔细查看您的事件日志。

Recycle Event Logs - You want to make sure you are logging app pool recycles for each event threshhold that you set - i.e. if you limit based off of requests limits, make sure that Request Limit logging is enabled.

回收事件日志 - 您希望确保为所设置的每个事件阈值记录应用程序池回收 - 即,如果基于请求限制进行限制,请确保启用了请求限制日志记录。

One thing to remember is that you should set retail="true" in the <deployment> element in your machine.config:

要记住的一件事是你应该在machine.config的 元素中设置retail =“true”:

<system.web>
    <!--
        <deployment
            retail = "false" [true|false]
        />
    -->
    <deployment retail="true" />
</system.web>

Not setting this will allow a site to turn debugging on, which allows unlimited timeouts in requests - not exactly ideal for a hoster...

不设置这将允许站点打开调试,这允许在请求中无限制超时 - 不完全适合于主机...

#2


2  

If you have a heavy traffic site, use long recycle schedule. If you have a low traffic site use shorter/default schedule to save memory.

如果您有繁忙的交通站点,请使用长时间的回收计划。如果您的流量较低,则使用较短/默认计划来节省内存。

I learned this from Al Zabir's blog: http://msmvps.com/blogs/omar/archive/2008/10/04/best-practices-for-creating-websites-in-iis-6-0.aspx

我从Al Zabir的博客中了解到这一点:http://msmvps.com/blogs/omar/archive/2008/10/04/best-practices-for-creating-websites-in-iis-6-0.aspx

Daniel S. is right, your session variables get destroyed on recycle, so make sure you test this well or have good error protection/recovery when getting your session objects.

Daniel S.是对的,您的会话变量在回收时会被破坏,因此请确保在获取会话对象时对此进行良好测试或具有良好的错误保护/恢复。

#3


1  

Tip: When you recycle your app, all your session variables are destroyed... so caution on this!

提示:当您回收应用程序时,所有会话变量都会被销毁...所以请注意这一点!

IMHO, keep the defaults.

恕我直言,保持默认值。

#4


1  

you need to cater the settings to your needs, take into account the amount of memory you have and the peak times of usage for your site/web application.

您需要根据需要满足设置需求,并考虑您拥有的内存量以及站点/ Web应用程序的高峰使用时间。

Also take into account the memory usage of your site/web application as if there are memory leaks you might be recycling more often then you think.

还要考虑您的站点/ Web应用程序的内存使用情况,就好像存在内存泄漏一样,您可能会更频繁地回收,然后您会想到。

Weigh up any leaks against the cost of recycling, as stated above you will lose state variables.

根据回收成本计算任何泄漏,如上所述,您将丢失状态变量。