6

I'm troubleshooting an issue we're seeing with all of our Windows Server 2016 servers. The more features we add to the operating system, the slower the features are to add.

For example, execute Add-WindowsFeature -Name NET-Framework-Core when I haven't added any other features, it operates at a normal pace.

However, after I've added a few dozen features (typically a web server), executing for example Add-WindowsFeature -Name Web-CGI takes over 10 minutes. As you can imagine, this makes spinning up a new server exceedingly slow, as there are around 60 features that get added to each machine.

Executing the command with -LogFile gives a useless log, reading like this:

5756: 2017-12-19 19:40:57.545 [ServerManagerPS]           Complete initializing log file.
5756: 2017-12-19 19:40:58.199 [ServerManagerPS]           45d625fe-30ef-4636-a79f-5ed8b9546d68 Enumerate server component ended with Success.
5756: 2017-12-19 19:41:03.268 [ServerManagerPS]           45d625fe-30ef-4636-a79f-5ed8b9546d68 Alter server component started. Component names: Web-CGI
5756: 2017-12-19 19:41:03.286 [ServerManagerPS]           45d625fe-30ef-4636-a79f-5ed8b9546d68 Alter server component ended with InProgress. The progress is 20
5756: 2017-12-19 19:41:04.295 [ServerManagerPS]           45d625fe-30ef-4636-a79f-5ed8b9546d68 Alter server component started. Component names: Web-CGI
5756: 2017-12-19 19:41:04.314 [ServerManagerPS]           45d625fe-30ef-4636-a79f-5ed8b9546d68 Get alteration state ended with InProgress. The progress is 24.
5756: 2017-12-19 19:41:05.324 [ServerManagerPS]           45d625fe-30ef-4636-a79f-5ed8b9546d68 Alter server component started. Component names: Web-CGI

With the final two lines repeated over and over again.

Performing this operation via the GUI makes no difference - it's just as slow. Once the feature is eventually installed, Get-WindowsFeature returns in an appropriate amount of time (almost instantly)

Has anyone else seen behaviour like this? Is there any way to delve deeper into the logs to find out what's going on?

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
  • [Looks like you're not the only one...](https://social.technet.microsoft.com/Forums/en-US/f252be5e-21d1-483c-b560-188b6fe0a188/windows-feature-very-slow-install-through-powershel?forum=WinServerPreview) and it hasn't been solved. :( – HopelessN00b Dec 19 '17 at 22:02
  • Yep I’ve seen that one, and these calls are also coming from DSC. (I just boiled it down to its root cause). Driving me nuts. I think I’ll bust out debugging tools tomorrow. – Mark Henderson Dec 19 '17 at 22:06
  • 1
    And whadda ya know. I can't reproduce after rebuilding this machine. – Mark Henderson Dec 20 '17 at 15:57

1 Answers1

-1

When you try to add a feature, the 1st thing the OS does is dig around the existing ones and their dependencies. So the more you previously added, the more it will take the OS to determine all that are installed.

Overmind
  • 3,076
  • 2
  • 16
  • 25
  • Sorry but it doesn't take upwards of 10 minutes to verify previous feature installation. If you'll note I actually mention that checking the installation of a feature is virtually instant ("Get-WindowsFeature returns in an appropriate amount of time (almost instantly)"). – Mark Henderson Dec 28 '17 at 13:09
  • It actually doesn't. That's only apparent. Get-WindowsFeature does not check for dependencies. – Overmind Jan 04 '18 at 07:24