Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在网上搜索 IIS 应用程序池内存使用情况,但我无法获得任何想要的结果。我想知道如何在 C# 中获取特定的应用程序池 CPU 大小?
PS:我尝试启动/停止应用程序池并且它可以工作,但我不知道如何访问 cpu 使用情况。
进程状态(内存使用/CPU使用)可以通过Process类查询。
Process
要与 IIS 粘合,您需要使用Microsoft.Web.AdministrationAPI 从应用程序池中获取工作进程信息。
Microsoft.Web.Administration
此 API 不是一个额外的库,而是作为 IIS 7 及更高版本 (%windir%\system32\inetsrv\Microsoft.Web.Administration.dll) 的一部分随 Windows 一起提供。