Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

M365DSC: versions > 1.20.1028.1 quadruple the total runtime

Open EricHindrichsen opened this issue 6 years ago • 2 comments

Details of the scenario you tried and the problem that is occurring

After upgrading from M365DSC 1.20.1028.1 to any newer version (we tried every single release after that one) our total runtime for a Apply- and Test-DscConfiguration run went up from 20-30mins to 90-100 mins. We didn't change anything in the environment (Azure DevOps release pipeline with MS-hosted agent) nor in the configuration - except replacing ZapEnabled with PhishZapEnabled and SpamZapEnabled in the EXOHostedContentFilterPolicy section. We can reproduce this 100% reliably by downgrading back to 1.20.1028.1 and then upgrading again to any newer version. It's independent from peak work hours and no issues with the respective O365 services being used were published by MS during those times.

Verbose logs showing the problem

The logs show that with version 1.20.1028.1 applying or testing a single resource takes 10 seconds on avarage, but with any newer version it's 45 seconds on average. For example, here's the exact same resource and setting in the same environment in version 1.20.1028.1 2020-11-24T08:26:19.9014108Z VERBOSE: [fv-az74-970]: LCM: [ End Test ] [[EXOAcceptedDomain]9f215e0f-63f2-4a36-8f95-25e15012e1d8] in 2020-11-24T08:26:19.9065537Z 12.4800 seconds. version 1.20.1118.1 (but we had the same result with 1.20.1104.1) 2020-11-25T14:19:44.0779484Z VERBOSE: [fv-az20-509]: LCM: [ End Test ] [[EXOAcceptedDomain]9f215e0f-63f2-4a36-8f95-25e15012e1d8] True in 2020-11-25T14:19:44.0780040Z 47.1050 seconds.

Suggested solution to the issue

We have no idea what is increasing the runtime so much.

The operating system the target node is running

Azure DevOps release agent (MS-hosted) with specification vs2017-win2016 (but also happens on windows-2019).

Version of the DSC module that was used ('dev' if using current dev branch)

1.20.1028.1 vs. any newer release

EricHindrichsen avatar Nov 27 '20 14:11 EricHindrichsen

@EricHindrichsen we believe this is related to an emergency workaround we had to introduce when the PowerShell Gallery went down at the beginning of November. We introduce a check to ensure the Gallery was available before attempting to check for a newer version of the tool, but this ended up being call every single time a resource was called, which introduced a performance glitch. This has been fixed in this week's release 1.20.1125.1. Can you verify if this version fixes the performance issues? Thanks

NikCharlebois avatar Nov 27 '20 15:11 NikCharlebois

@NikCharlebois you are right, with version 1.20.1125.1 we are back to normal runtimes again. Thanks a lot for the quick fix!

EricHindrichsen avatar Nov 27 '20 15:11 EricHindrichsen