Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sarkie opened this issue Jan 11, 2024 · 1 comment
Open

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

Sarkie opened this issue Jan 11, 2024 · 1 comment
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@Sarkie
Copy link

Sarkie commented Jan 11, 2024

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!

@Sarkie Sarkie added the Status: Untriaged An issue that has yet to be triaged. label Jan 11, 2024
@Sarkie
Copy link
Author

Sarkie commented Jan 15, 2024

@jeremiahsnapp is this repo still the right place?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant