开发者

Monitoring AppDomain resources and setting thresholds

My company hosts components authored by third parties. Each component is hosted in its own AppDomain, but may share a server with other components. Recently, I believe that one or more badly written components have been misbehaving and consuming too many resources, causing server crashes. I would like to be able to:

  1. Ascertain which component is the guilty party or, in other words, to determine how many resources each component's appdomain is comsunimg (memory, OS handles, CPU cycles etc).

  2. Put threshol开发者_运维技巧ds on appdomains, so even if a component does go crazy, the resources it can consume are limited, and it should hopefully not affect the performance of other components on the same server.

Anyone got any ideas?


While this isn't a complete answer to my question, it does satisfy most of my requirements.

  1. I have since discovered the MonitoringIsEnabled, MonitoringSurvivedMemorySize, MonitoringSurvivedProcessMemorySize, MonitoringTotalAllocatedMemorySize and MonitoringTotalProcessorTime properties of the AppDomain object (http://msdn.microsoft.com/en-us/library/z9744cf9.aspx), which satisfy some of my requirements from 1 above. But I would still like to know about OS handles, and if possible be able to set thresholds. Is this doable?

  2. If it is not possible to set thresholds on resource usage, I guess I can instead continually monitor the domain using the properties above and unload it if I detect that it exceeds a certain amount of memory or CPU time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜