Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is WMI so much slower tha using utilities like PsExec or PsList?

I'm doing various OS management and querying tasks using WMI, but it allways take a long time for first WMI call(10 to 15s). When I tried few tools from sysinternals I found that they are so much faster and I want to know how is this possible. For instance how can PsList tool returns result in under 2 second and for wmi it takes at least 15 seconds. Much of this time is used for authentication and not actual work, and next wmi query for the same machine is much faster.

Is possible to see the source code of sysinternals utilites ? Do they use WMI or direct win32 api calls ?

like image 582
Primoz Avatar asked Aug 29 '11 19:08

Primoz


People also ask

What is the use of WMI service?

WMI provides users with information about the status of local or remote computer systems. The purpose of WMI is to help administrators manage different Windows operational environments, including remote systems.

Can I end WMI provider host?

WMI Provider Host is a system service, therefore, it cannot be permanently stopped or disabled.

Is WMI provider host a virus?

While it's natural to be curious about Windows processes that you aren't familiar with, you can rest easy, as WMI Provider Host is an entirely safe process for Windows and should be left running.


1 Answers

WMI has a lot of overhead: authentication/authorizing access to WMI namespaces/DCOM/RPC. It is designed for easy and secure management, not for performance.

Suggested reading: WMI: Improving your WMI application performance in fan-out scenario

like image 82
Sheng Jiang 蒋晟 Avatar answered Oct 20 '22 19:10

Sheng Jiang 蒋晟