Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I improve WMI performance in .NET?

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?

like image 928
devgeezer Avatar asked Jun 25 '09 19:06

devgeezer


1 Answers

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."

like image 74
David Avatar answered Oct 21 '22 21:10

David