windows – svchost.exe上的细粒度性能报告

这总是困扰着我,所以我会问服务器故障社区.

我喜欢Process Explorer,不仅仅是跟踪你在Task Manager中获得的高级任务.但我一直想知道在svchost下单个进程中托管的十几项服务中的哪一项正在使我的处理器激增.

那么……是否有任何非侵入性的方式来找到这些信息?

是的,有一种(几乎)非侵入性和简单的方式:

拆分每个服务以在其自己的SVCHOST.EXE进程中运行
消耗cpu周期的服务将很容易看到
在Process Explorer中(需要“=”之后的空格):

SC Config Servicename Type= own

在命令行窗口中执行此操作或将其放入BAT
脚本.需要管理权限
在需要之前需要重新启动计算机
影响.

原始状态可以通过以下方式恢复:

SC Config Servicename Type= share

示例:使Windows Management Instrumentation在a中运行
单独的SVCHOST.EXE:

SC Config winmgmt Type= own

除了可能增加之外,这种技术没有任何不良影响
内存消耗略有.除了观察cpu
每个服务的使用也使得观察页面变得容易
故障增量,磁盘I / O读取速率和磁盘I / O写入速率
每项服务.
对于Process Explorer,菜单View / Select Columns:
选项卡进程内存/页面错误Delta,
选项卡Process Performance / IO Delta Write Bytes,
选项卡Process Performance / IO Delta Read Bytes,
分别.

在大多数系统上,只有一个SVCHOST.EXE进程
有很多服务.我已经使用了这个序列(它可以
直接粘贴到命令行窗口):

rem  1. "Automatic Updates"
SC Config wuauserv Type= own

rem  2. "COM+ Event System"
SC Config EventSystem Type= own

rem  3. "Computer browser"
SC Config browser Type= own

rem  4. "Cryptographic Services"
SC Config CryptSvc Type= own

rem  5. "distributed Link Tracking"
SC Config TrkWks Type= own

rem  6. "Help and Support"
SC Config helpsvc Type= own

rem  7. "Logical disk Manager"
SC Config dmserver Type= own

rem  8. "Network Connections"
SC Config Netman Type= own

rem  9. "Network Location Awareness"
SC Config NLA Type= own

rem 10. "Remote Access Connection Manager"
SC Config RasMan Type= own

rem 11. "Secondary logon"
SC Config seclogon Type= own

rem 12. "Server"
SC Config lanmanserver Type= own

rem 13. "Shell Hardware Detection"
SC Config ShellHWDetection Type= own

rem 14. "System Event Notification"
SC Config SENS Type= own

rem 15. "System Restore Service"
SC Config srservice Type= own

rem 16. "Task Scheduler"
SC Config Schedule Type= own

rem 17. "Telephony"
SC Config TapiSrv Type= own

rem 18. "Terminal Services"
SC Config TermService Type= own

rem 19. "Themes"
SC Config Themes Type= own

rem 20. "Windows Audio"
SC Config AudioSrv Type= own

rem 21. "Windows Firewall/Internet Connection Sharing (ICS)"
SC Config SharedAccess Type= own

rem 22. "Windows Management Instrumentation"
SC Config winmgmt Type= own

rem 23. "Wireless Configuration"
SC Config WZCSVC Type= own

rem 24. "Workstation"
SC Config lanmanworkstation Type= own

rem End.

相关文章

Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...
Windows文件操作基础代码 Windows下对文件进行操作使用的一段...
Winpcap基础代码 使用Winpcap进行网络数据的截获和发送都需要...
使用vbs脚本进行批量编码转换 最近需要使用SourceInsight查看...