2016-11-15 97 views

回答

5

这可能是一个只有Azure功能,所以我建议您将其添加到转换文件中。即web.autoheal.config

<?xml version="1.0" encoding="utf-8"?> 
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
    <system.webServer> 
    <monitoring xdt:Transform="Insert"> 
     <triggers> 
     <!-- Scenario #1: Recycling based on Request Count --> 
     <requests count="1000" timeInterval="00:10:00"/> 
     <!-- Scenario #2: Recycling based on slow requests --> 
     <slowRequests timeTaken="00:00:45" count="20" timeInterval="00:02:00" /> 
     <!-- Scenario #3: Logging an event (or recycling) based on HTTP status code(s) --> 
     <statusCode> 
      <add statusCode="500" subStatusCode="100" win32StatusCode="0" count="10" timeInterval="00:00:30"/> 
     </statusCode> 
     <!-- Scenario #4: Taking custom actions (or recycling/logging) based on memory limit --> 
     <memory privateBytesInKB="800000"/> 
     </triggers> 
     <!-- Scenario #1 & #2 Action --> 
     <actions value="Recycle"/> 
     <!-- Scenario #3 Action --> 
     <actions value="LogEvent"/> 
     <!-- Scenario #4 Action --> 
     <actions value="CustomAction"> 
     <customAction exe="d:\home\procdump.exe" parameters="-accepteula w3wp d:\home\w3wp_PID_%1%_" /> 
     </actions> 
    </monitoring> 
    </system.webServer> 
</configuration> 
+0

由于它是一个Azure唯一的功能,我假设我可以忽略警告无效的子元素'监测',正确的? –

+0

是的,你可以。在发布之前使用此xdt转换。 – EvertonMc

+1

当然,编辑它以涵盖您的要求。我在这里发现了一些技巧https://channel9.msdn.com/Series/Windows-Azure-Web-Sites-Tutorials/Auto-Haling-an-Azure-App-Service – EvertonMc

相关问题