简体   繁体   English

WMI查询在特定计算机(本地)上运行非常慢

[英]WMI query running very slow on a specific machine (local)

I have a WMI query that is SELECT * FROM win32_printer where name = 'My Printer' 我有一个SELECT * FROM win32_printer where name = 'My Printer'的WMI查询, SELECT * FROM win32_printer where name = 'My Printer'

It's running as a local query. 它作为本地查询运行。

I'm testing it through WBEMTest and through the code written in C# and in all cases on a specific machine it is really slow (~1 minute). 我正在通过WBEMTest以及通过用C#编写的代码对其进行测试,并且在所有情况下,在一台特定的计算机上,它真的很慢(〜1分钟)。 I've checked the WMI Activity trace logs and there are no errors. 我已经检查了WMI活动跟踪日志,没有任何错误。 Does anyone have any more hints on how to find out the problem for this specific machine. 是否有人对如何找到此特定计算机的问题有更多提示。

WMI is slow as it is mainly designed for management not performance. WMI很慢,因为它主要是为管理而不是性能而设计的。 There are a lot of things that happen in the background when calling a WMI query. 调用WMI查询时,后台会发生很多事情。 Also queries that return a lot of data entries are slow, however in your particular query I hardly believe that is an issue. 同样,返回大量数据条目的查询速度很慢,但是在您的特定查询中,我几乎不认为这是一个问题。

You can check this blog post for ways to improve your query performance. 您可以查看此博客文章 ,以了解改善查询性能的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM