A new feature that we’re introducing with Update Rollup 11 for Windows Azure Pack is Auto Heal. Auto Heal is a monitoring tool and certain actions can be automatically taken when a condition is reached. For example, if your site uses 500 MB of memory, Auto Heal can be configured to recycle the application pool.
Let’s take a look at how to configure Auto Heal to recycle your site if it reaches 1 GB of memory usage.
First, to use Auto Heal, review the following requirements:
If you’re using an out-of-the-box application, you can download the web.config file from your server and then add the following to the section using your preferred text editor:
<system.webServer> <monitoring> <triggers> <memory privateBytesInKB="1000000"/> </triggers> <actions value="Recycle"/> </monitoring> </system.webServer>
Save your changes and then you can upload the updated file to the server.
If you’re using a homegrown or custom application and you’re editing through Visual Studio, you may see the following warning if you were to try using Auto Heal:
The element ‘system.webServer’ has invalid child element ‘monitoring’
To work around the problem, we highly recommend using a release configuration and then add the following:
<system.webServer> <monitoring xdt:Transform="Insert"> <triggers> <memory privateBytesInKB="1000000"/> </triggers> <actions value="Recycle"/> </monitoring> </system.webServer>
Here’s an example of what your Web.Release.config might look like: