Chef load time on Windows

Hi Chefs,

I’ve recently been looking at the run time for Chef on Windows - when
testing recipes, the 20-second start time is very frustrating when compared
to the <1 second on Linux.

I’m no Ruby expert, and was beginning to accept the general consensus of
"Ruby on Windows is just slow". However, I then came across the ruby-perf
tool, and what I found surprised me. Most of the load time was spent in the
WIN32OLE gem; the calls that Windows plugins in Ohai are very slow.

By disabling most of the Windows plugins, load time of Chef dropped to about
3 seconds; disabling all of the plugins I didn’t need reduced the load time
to 1.5 seconds. Loading the faster_require gem reduces the load time to 0.6
seconds – that’s a 30x reduction!

While I wouldn’t want to see the plugins disabled by default, I wanted to
point this out to any other users working on Windows who are frustrated by
the slow load time when it can be easily resolved for development and maybe
controlled deployments. Sorry if it’s already well known.

In my client.rb:
Ohai::Config[:disabled_plugins] = [

The following plugins are required for Chef to work

“hostname”,“windows::hostname”,“windows::platform”,

I wanted the following plugins enabled

“ruby”,“chef”,“ohai”,“platform”,

“kernel”,“languages”,“c”,“cloud”,“ec2”,“network”,“rackspace”,“eucalyptus”,
“command”,“dmi”,“dmi_common”,“erlang”,“groovy”,“ip_scopes”,“java”,“keys”,
“lua”,“mono”,“network_listeners”,“ohai_time”,“passwd”,“perl”,“php”,
“python”,“uptime”,“virtualization”,“windows::network”,“windows::kernel”,
“windows::virtualization”,“windows::cpu”,“windows::filesystem”
]

Dan.