How to handle application pools which uses too much memory or CPU? I would like to have possibility to select for how much time application pool is using certain amount of memory or cpu (or both) before it will be recycled. Any idea how to achieve this? IIS7 allows to kill app pool when it reaches some level of CPU usage but I'm interested in recycling it.
Thanks
Have you tried setting the Recycling Conditions for your app pool? You can configure IIS to recycle the app pool at fixed intervals, fixed number of requests, at specific time or at certain memory thresholds.
This will not recycle based on cpu usage though, but at least you can have the app pool recycled at certain intervals.
That said, I don't think that you should need to recycle the app pool under normal circumstances. If you need to do this very often, I'd say you either have a "bad" application or you need to give the application more resources.
Windows Server Resource Manager is recommended while installing IIS. It's included with some Windows Server editions - check out your Features list to see if it's there.
This utility is application pool aware, and lets you limit CPU and working set for application pools.
This is less destructive than a CPU consumption-based recycle trigger, but needs careful setup. It typically only makes a difference when one app pool is overconsuming, which sounds like your situation; it might be worth checking out.