Reputation: 4189
I've inherited code that makes numerous remote WMI calls. When I repeatedly pause execution and look at the call-stack it's almost always in a ManagementScope.Connect()
call. A new connection seems to be made with each WQL query.
Despite limited trial and error, I haven't found any big wins yet in improving the performance of the WMI calls.
I've tried caching previous results, reusing connections, and avoiding the dreaded "select *
". These haven't given me the performance improvements that I'd like. I'm interested to understand the impact of environment on WMI performance, but the code needs to run in a wide variety of environments that are probably beyond my control.
If any, what are the do's and don't's of performance oriented WMI access in .NET?
Upvotes: 11
Views: 4893
Reputation: 1237
Not my area of expertise, but this might be of some help:
WMI: Improving your WMI application performance in fan-out scenario
"In this blog, I will talk about three different ways of connecting to a remote machine using WMI to perform multiple WMI operations, and their performance differences."
Upvotes: 6