监控AppDomain资源并设置阈值

发布于 2024-10-17 16:49:39 字数 296 浏览 1 评论 0原文

我的公司托管第三方编写的组件。每个组件都托管在自己的 AppDomain 中,但可能与其他组件共享服务器。最近,我认为一个或多个写得不好的组件行为不当并消耗了太多资源,导致服务器崩溃。我希望能够:

  1. 确定哪个组件是有罪的一方,或者换句话说,确定每个组件的应用程序域有多少资源(内存、操作系统句柄、CPU 周期等)。

  2. 在appdomains上设置阈值,这样即使某个组件确实发疯了,它可以消耗的资源也是有限的,并且它应该不会影响同一服务器上其他组件的性能。

有人有什么想法吗?

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 thresholds 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一个人的旅程 2024-10-24 16:49:39

虽然这不是我问题的完整答案,但它确实满足了我的大部分要求。

  1. 此后,我发现了 AppDomain 对象的MonitoringIsEnabled、MonitoringSurvivedMemorySize、MonitoringSurvivedProcessMemorySize、MonitoringTotalAlownedMemorySize 和MonitoringTotalProcessorTime 属性(http://msdn.microsoft.com/en-us/library/z9744cf9.aspx),它满足了我上面1中的一些要求。但我仍然想了解操作系统句柄,如果可能的话能够设置阈值。这可行吗?

  2. 如果无法设置资源使用阈值,我想我可以使用上述属性持续监视域,并在检测到它超过一定量的内存或 CPU 时间时卸载它。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文