Knife commands on windows really slow - troubleshooting

Hi fellow chef gurus,

for a while now knife cookbook commands have been reaaaaaally slow. I don't remember if unique to chef-workstation vs chefdk so that doesn't help narrow it down ...

I'm using windows :
Chef Workstation version: 0.9.42
Chef Infra Client version: 15.3.14
Chef InSpec version: 4.16.0
Chef CLI version: 1.0.16
Test Kitchen version: 2.3.3
Cookstyle version: 5.6.2


PS C:\AppX\chef-repo\cookbooks> knife cookbook upload AppX
C:/opscode/chef-workstation/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead (StructuredWarnings::StandardWarning)
Uploading AppX [4.0.1]
Uploaded 1 cookbook.
PS C:\AppX\chef-repo\cookbooks>

took ~ 3 minutes to end.

Using process explorer I can see its basically running the following :

"C:\opscode\chef-workstation\bin..\embedded\bin\ruby.exe" "C:\opscode\chef-workstation\bin\knife" cookbook upload AppX
"C:\opscode\chef-workstation\embedded\bin\ruby.exe" "C:\opscode\chef-workstation\embedded\bin\cookstyle" -f j c:\AppX

timings are very similar for very small cookbooks to very large :

large cookbook

run 0m 00s
fiddler warning @ 2m 10s
uploading cookbook message @ 2m 55s
done 3m 00s

small wrapper cookbook

run 0m 00s
fiddler warning @ 2m 4s
uploading cookbook message 2m 45s
done 2m 48s

so basically 3 minutes on any upload - its used to be so much quicker. Anyone else have this. Anyway of troubleshooting the cookstyle -f j commands in debug logging?

i tried the knife -V but all it gives in the log is :

INFO: Using configuration from C:/AppX/chef-repo/.chef/knife.rb
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Saving AppX
INFO: Uploading files
INFO: Upload complete!

tried "chef verify" to check for general issues but that is no longer there .... weird

PS C:\AppX\chef-repo\cookbooks> chef verify
Unknown command `verify'.

Cheers to anyone that can help with suggestions - yes i'm using windows, no not an option to switch to linux ... :slight_smile:

No one else has slowness on Knife commands or no one else is using windows ... :slight_smile:

1 Like

Hello dave12345,

Please check out the issue over in the Chef repo here: - there is work being done to make the Windows experience better.

Daniel Bright


The good news is that we're actively working on speeding up our chef and knife command experiences. Chef Workstation now ships with new version of the chef command that will let us cut parts of the CLI to be 10-20x faster over time. The next release of Workstation and DK also ship with 2 important optimizations to Ruby on Windows that should speed things up considerably. There's a good amount of work left to do, but we're aware of the slowness and we're working on it.


Thank you - look forward to a quicker experience :slight_smile:

I'm also having the exact same issue