Skip to content

Improve performance of WMI calls - Stop using SELECT * FROM #18

@Sarkie

Description

@Sarkie

Describe the Enhancement

Improve the performance of the WMI calls

Describe the Need

All users would get a bump in performance

Current Alternative

The current solution works fine

Can We Help You Implement This?

I'm not really a Ruby Dev, so not sure if it's a quick fix.

Hi,
I know this project doesn't seem to be updated that often (as it just works) but noticed in our monitoring WMI calls and looks to be from Chef / ruby.exe

https://github.com/chef/wmi-lite/blob/main/lib/wmi-lite/wmi.rb#L35
https://github.com/chef/wmi-lite/blob/main/lib/wmi-lite/wmi.rb#L39

On these two lines of code, you are using SELECT * from
This is very slow for WMI calls and for slower servers, that can impact the WMI host.

If you know the columns you need, then it is best to ask for them up front

E.g. from OHAI.
wmi.first_of("Win32_ComputerSystemProduct")["UUID"]

Should turn into
SELECT UUID from Win32_ComputerSystemProduct

https://evilgpo.blogspot.com/2014/11/wmi-filter-queries-and-thoughts-on.html

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UntriagedAn issue that has yet to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions