在 Azure 网站上禁用池回收 [英] Disable pool recycling on Azure Websites

查看:16
本文介绍了在 Azure 网站上禁用池回收的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Azure 网站上部署了一个网站,我想禁用池回收.

I have a website deployed on Azure Websites and I want to disable pool recycling.

如果您有常规的 IIS 安装,您可以在应用程序池高级设置中通过将回收 -> 禁用重叠回收"设置为 true 来禁用此功能.

If you have a regular IIS installation, you can disable this in application pool advanced settings by setting "Recycling -> Disable overlapped recycle" to true.

但我似乎无法在 azure 管理控制台中找到此选项,我也没有在网上找到有关此主题的任何信息.

Yet I can't seem to find this option in the azure management console, nor do I find any information on this subject online.

任何指针将不胜感激!

推荐答案

非常感谢 Puneet Gupta 为我指明了正确的方向!我无法使用确切的解决方案,但它让我走上了正确的道路.

Thanks a lot Puneet Gupta for pointing me in the right direction! I couldn't use the exact solution, but it set me on the right path.

我是这样解决这个问题的:

Here's how I solved this:

1) 掌握 applicationHost.config.最简单的方法是通过文件"通过 SCM 控制台,然后按照 json 中的链接.最后,您将在此处结束:https://YOUR_WEBSITE_NAME.scm.azurewebsites.net/api/vfs/LocalSiteRoot/Config/applicationhost.config

1) Get your hands on the applicationHost.config. The easiest way is going through the SCM Console via "files" and then follow the links in json. In the end, you end up here: https://YOUR_WEBSITE_NAME.scm.azurewebsites.net/api/vfs/LocalSiteRoot/Config/applicationhost.config

2) 识别重叠回收的当前状态.在 applicationHost.config 文件中,查找applicationPools"元素它应该是这样的:

2) Identify the current status of overlapped recycle. In the applicationHost.config file, look for the "applicationPools" element It should look like this:

<applicationPools>
  <add name="YOUR_SITE_NAME" managedRuntimeVersion="v4.0">
    <processModel identityType="ApplicationPoolIdentity" />
  </add>
  <add name="~1YOUR_SITE_NAME" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
    <processModel identityType="ApplicationPoolIdentity" />
  </add>
</applicationPools>

如果你看到这个,那么重叠回收是启用!你不能直接写入这个文件,但幸运的是微软给了我们改造它的能力!

If you see this, then overlapped recycle is ENABLED! You can't write directly to this file but fortunately microsoft gives us the power to transform it!

3) 改造它!您可以通过将 applicationHost.xdt 文件放在网站的/site 目录中来转换 applicationHost.config 文件(请注意,网站本身部署在/site/wwwroot 目录中,因此您的 applicationHost.xdt 转换必须驻留在您网站所在位置的父文件夹.如果你想禁用重叠回收,那么这就是你放在文件中的内容:

3) Transform it! You can transform the applicationHost.config file by placing an applicationHost.xdt file in the /site directory of your website (mind you that the website itself is deployed in the /site/wwwroot directory, so your applicationHost.xdt transform must reside in the parent folder of where your website is. If you want to disable overlapped recycle, then this is what you put in the file:

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">>
  <system.applicationHost>
    <applicationPools>
      <add name="YOUR_SITE_NAME" xdt:Locator="Match(name)">
        <recycling disallowOverlappingRotation="true" xdt:Transform="Insert" />
      </add>
      <add name="~1YOUR_SITE_NAMEd" xdt:Locator="Match(name)">
        <recycling disallowOverlappingRotation="true" xdt:Transform="Insert" />
      </add>
    </applicationPools>
  </system.applicationHost>
</configuration>

4) 重启网站最后,您需要重新启动您的站点以应用您的转换.重新启动后,再次转到第 1 步,您现在应该会看到以下内容:

4) restart the site finally you need to restart your site to have your transformations applied. After restart, go to step 1 again and you should now see this instead:

<applicationPools>
  <add name="YOUR_SITE_NAME" managedRuntimeVersion="v4.0">
    <processModel identityType="ApplicationPoolIdentity" />
    <recycling disallowOverlappingRotation="true" />
  </add>
  <add name="~1YOUR_SITE_NAME" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
    <processModel identityType="ApplicationPoolIdentity" />
    <recycling disallowOverlappingRotation="true" />
  </add>
</applicationPools>

等等:重叠回收现在已在您的 azure 网站上禁用.

et voila: overlapped recycle is now disabled on your azure website.

这篇关于在 Azure 网站上禁用池回收的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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