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

Windows packages plugin - Get packages from registry #778

Merged
merged 3 commits into from
Mar 30, 2016

Conversation

sh9189
Copy link
Contributor

@sh9189 sh9189 commented Mar 17, 2016

Windows packages plugin uses Win32_Product WMI class to get list of installed packages. This causes reconfiguration of all installed windows packages in win2008r2/win2012r2 as per https://support.microsoft.com/en-us/kb/974524, spewing windows event log with 'Package reconfigured messages'. The PR removes the query to Win32_Product WMI class and uses windows registry to get list of all installed packages.
cc @johnbellone

@tas50
Copy link
Contributor

tas50 commented Mar 17, 2016

@sh9189 Any chance you can benchmark this? We previously disable the plugin due to the slow performance using WMI. I'm curious if this would allow us to enable this out of the box now.

@sh9189
Copy link
Contributor Author

sh9189 commented Mar 17, 2016

Sure, will work on getting some benchmarks for comparison with the previous version.

@sh9189
Copy link
Contributor Author

sh9189 commented Mar 18, 2016

@tas50 I did some simple tests on my local PC running windows 7. These are results I see,

Run 1 Run 2 Run 3 Run 4 Run 5
Use WMI (without packages plugin) 23.070s 21.623s 21.685s 21.882s 23.454s
Use WMI (with packages plugin) 30.919s 30.447s 30.608s 30.608s 30.892s
Use registry (without packages plugin) 23.927s 23.693s 23.329s 23.450s 23.924s
Use registry (with packages plugin) 24.480s 24.504s 24.429ss 24.308s 24.689s

When using WMI to query packages, the packages plugin adds almost 7-8 seconds, but using windows registry to query packages, the packages plugin adds only 0.5-1 second.

I have a pushed a commit to enable packages plugin by default to see how it performs on appveyor.

@sh9189
Copy link
Contributor Author

sh9189 commented Mar 18, 2016

On appveyor, I just used start time and end time for bundle exec ohai command to get time taken for ohai. These are results I see,

Ruby 2.0 Ruby 2.1 Ruby 2.2
Use registry (without packages plugin) 16:20 - 16:38 = 18 seconds 16:09 - 16:25 = 16 seconds 16:14 - 16:30 = 16 seconds
Use registry (with packages plugin) 16:22 - 16:40 = 18 seconds 01:57 - 02:14 = 17 seconds 16:10 - 16:26 = 16 seconds

From the above, it looks like the packages plugin adds almost little to no overhead on appveyor when reading from windows reqistry.

collect_data(:linux) do
if configuration(:enabled)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this plugin was disabled by default here. Are you intentionally reverting that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I think I have the proper background on why this plugin was disabled. It seems safe to enable it again. :)

@mcquin
Copy link
Contributor

mcquin commented Mar 30, 2016

Code looks great! Can we get some reviews from @chef/client-windows ?

@tas50
Copy link
Contributor

tas50 commented Mar 30, 2016

👍

1 similar comment
@ksubrama
Copy link

👍

@tas50 tas50 merged commit 02defc6 into chef:master Mar 30, 2016
@thommay thommay added Type: Enhancement Adds new functionality. and removed Enhancement labels Jan 24, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants