Understanding Action Script

Topics: PolyMon 2.x
Aug 8, 2011 at 9:15 PM

So my goal or hope is to be able to do an application pool reset if a URL comes back 404.  We're having SPDispose / Memory Leak issues and temporarily the fix to get the server backup is an application pool reset until we identify the problem app.  so I was hoping to use the Action Script capacity of Polymon to remotely run a powershell to reset an application pool.  My intention was to run it if the initial URL monitor fails.  Is this doable?  Am I understanding Action Scripts and it's use correctly?

Aug 10, 2011 at 6:44 PM
Edited Aug 10, 2011 at 6:45 PM

You can absolutely do that with an action script.  What version of IIS?  I think VBScript might be the best answer for IIS6.  There's a lot of VBScript examples for IIS6 if you google.  I'm not sure about IIS7/7.5, although it might use WMI calls, which would be easier under PowerShell.

Anyway, in your ActionScript, you look at the status.  If the status is 3 (FAIL), then you run the command to recycle the application pool.

Your biggest obstacle will be permissions.  Your PolyMon service account (not the same account as the PolyMon manager) needs permission to run the respective commands in the script.  For IIS 6, this will probably require local administrator or SYSTEM.  For IIS 7, you can more granularly assign permissions. 

Make sure you simulate an outage using the service because it may work fine from the manager under your account, but fail from the PolyMon service due to permissions.

I want to ask though: if you have a memory leak issue, have you tried setting the application pool to recycle if the memory exceeds a max threshold (Maximum virtual memory setting)?  We have this OLD ASP.Net 1.1 app that is no longer supported that also has a memory leak, and we use that setting to make sure it recycles after it grows past 500MB of RAM.  The solution works well, without any noticible disruption to users.  :-)

Aug 18, 2011 at 6:32 PM

Thank you for your response!  Yes, we've looked at that as a solution and it hasn't been consistent when the leak (if it's the root cause) would surface.  It turns out we had some application crawling our environment which caused some o the outages we saw so it's not a huge priority anymore.  However we did run a tool by microsoft called SPDisposeCheck which is designed to help look for memory leaks (basically things not spdisposed properly which seems common).  Link if anyone stumbles on this with similar issues in SharePoint:

http://archive.msdn.microsoft.com/SPDisposeCheck

Aug 22, 2011 at 8:54 PM

Leave it to SharePoint to not work with the IIS App Pool recycling settings.  :-)  That's a great link too.  Thanks for sharing.