chefDK on windows painfully slow

Running commands via powershell for chefDK on winddows7 x86-64, latest version (download today) is painfully slow.

Running the same chef commands on a cloud vm talking to the same chef-server or even local-mode stuff, is 10x faster.

any idea why that might be? laptop is plenty capable, but chefDK via powershell just crawls in its execution.

Ruby is slower on Windows, but it shouldn’t be 10x slower.

Are you using the ChefDK Powershell that is added to the start menu, or are you opening powershell directly?

Have you watched the performance monitor to see if your disk, memory, or CPU bound?

What does Measure-Command { chef } in powershell return for time?

What would you expect for that output? I was thinking sub-second, but it was 8.25
C:\Users\jmiller\Desktop> measure-command {chef}

Days : 0Hours : 0Minutes : 0Seconds : 8Milliseconds : 257Ticks : 82575679TotalDays : 9.55737025462963E-05TotalHours : 0.00229376886111111TotalMinutes : 0.137626131666667TotalSeconds : 8.2575679TotalMilliseconds : 8257.5679

btm Chef Software Staff
November 29 |

Ruby is slower on Windows, but it shouldn’t be 10x slower.

Are you using the ChefDK Powershell that is added to the start menu, or are you opening powershell directly?

Have you watched the performance monitor to see if your disk, memory, or CPU bound?

What does Measure-Command { chef } in powershell return for time?

Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

for good measure, i ran it two more times. both additional times it took over 12 seconds.
ouch!

btm Chef Software Staff
November 29 |

Ruby is slower on Windows, but it shouldn’t be 10x slower.

Are you using the ChefDK Powershell that is added to the start menu, or are you opening powershell directly?

Have you watched the performance monitor to see if your disk, memory, or CPU bound?

What does Measure-Command { chef } in powershell return for time?

Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

There must be some broader issue of Ruby on my windows PC. I tried to run a knife command and got no output and it never completed.
It was a simple bootstrap for a single trivial cookbook. It never produced any output and ran in the ChefDK Powershell window for more than 12 hours.
I launched another cloud vm configured the client, copied all the files from the windows chefDK to the cloud vm new workstation, and was able to run the same knife bootstrap back to the same node I was trying to bootstrap from the windows ChefDK.
If I was going to dig into why the knife command never gets any output to STDOUT and hangs forever, do you have any pointers on how might I do that? tracing a command in powershell? tracing ruby execution?

Job

btm Chef Software Staff
November 29 |

Ruby is slower on Windows, but it shouldn’t be 10x slower.

Are you using the ChefDK Powershell that is added to the start menu, or are you opening powershell directly?

Have you watched the performance monitor to see if your disk, memory, or CPU bound?

What does Measure-Command { chef } in powershell return for time?

Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

One thing I would do is run the knife command with -VV to get debug output to see if anything is emitted before the hang. I’d also look to see if the ruby process is running at all if no output is generated still.

-vv on Windows doesn’t seem to work. I can use --verbose or -V, but not the -vv (maximum verbosity), it doesn’t seem to understand that.
I’m a newbie to chef. my chef knife commands were using --attributes ipaddress, instead of the default of FQDN if you exclude it.
turning on verbose issued a warning showing me that because of the attribute i was passing to the knife ssh command (ipaddress), it was using the virtual cloud networks private IP in the SSH connection, causing a timeout. However, when I ran that same command in a cloud based workstation in the same virtual cloud network as the Chef Server and node, it didn’t have trouble resolving them.
It also seems that powershell though buffers all output to STDOUT. In other words, I don’t get any output to the screen, until the command finishes, at which point, I see everything it was doing during its run-time execution.
I’m sure I can figure out how to fix that.

was -VV uppercase? I’ve definitely had success with that on windows in the past.

The docs show it as lowercase: -VV

but -VV (uppercase) works

There is definitely something amiss here and it isn’t buffering.
If I run a measure command on a knife node list command it take about 20 seconds.
A packet trace indicates that the actual request wasn’t issued to the chef server until after 18s
A single thread worth of CPU is consumed for those 18 seconds
This is also after a knife rehash, prior to that it was 48 seconds for the same command.

It is verging on unusable.

Terraform chef provider seems to be able to issue commands in rapid succession so it is all down to the ruby compile/interpretation or whatever it does. Replicated on numerous environments so it isn’t down to my build.

I am surprised there hasn’t been a revolt about this so I can only assume it doesn’t affect everybody…not sure where to go from here, I did do a procmon trace which I now can’t lay my hands on, no single thing jumped out at me but it did seem like it was doing the same thing over and over in a loop.

@ken.gaul Since you are necro-ing a thread from a long while ago, it would help if you specified which version of ChefDK you are running and which version of Windows.

Sorry.

ChefDK 13.6.4 on both win 7 and win 8.1

Same thing for me on Windows 10 . I usually use CentOS or Ubuntu and this is a brand new W10 laptop, 32 GB of RAM and a quad core CPU.
As stated previously, borderline unusable.

PowerShell 5.1.17134.407 (Microsoft Windows NT 10.0.17134.0)
Ohai, welcome to ChefDK!

PS C:\WINDOWS\system32> chef-client --version
Chef: 14.8.12

PS C:\WINDOWS\system32> Measure-Command { chef-client --version }


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 25
Milliseconds      : 244
Ticks             : 252445103
TotalDays         : 0.000292181832175926
TotalHours        : 0.00701236397222222
TotalMinutes      : 0.420741838333333
TotalSeconds      : 25.2445103
TotalMilliseconds : 25244.5103



PS C:\WINDOWS\system32> Measure-Command { chef-client --version }
PS C:\WINDOWS\system32> Measure-Command { chef --version }


Days              : 0
Hours             : 0
Minutes           : 1
Seconds           : 58
Milliseconds      : 853
Ticks             : 1188535346
TotalDays         : 0.00137561961342593
TotalHours        : 0.0330148707222222
TotalMinutes      : 1.98089224333333
TotalSeconds      : 118.8535346
TotalMilliseconds : 118853.5346

PS C:\WINDOWS\system32> Measure-Command { chef }


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 14
Milliseconds      : 697
Ticks             : 146978322
TotalDays         : 0.000170113798611111
TotalHours        : 0.00408273116666667
TotalMinutes      : 0.24496387
TotalSeconds      : 14.6978322
TotalMilliseconds : 14697.8322



PS C:\WINDOWS\system32> Measure-Command { chef-client }


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 59
Milliseconds      : 512
Ticks             : 595124274
TotalDays         : 0.000688801243055556
TotalHours        : 0.0165312298333333
TotalMinutes      : 0.99187379
TotalSeconds      : 59.5124274
TotalMilliseconds : 59512.4274

If there’s anymore info I can provide please let me know

This is an issue with the way ruby is compiled for windows. There are some ways people have tried to use WSL to get around the problem or a linux virtual machine is an option as well.