Issues icon indicating copy to clipboard operation
Issues copied to clipboard

Improve efficiency of bootstrapping scripts during deployments

Open N-lson opened this issue 2 years ago • 1 comments

The enhancement

What is the problem this solves or benefit it gives

In order to provide the correct flavor of Calamari (based on machine OS and architecture) we run a pre-check script. This gets run too frequently at the moment. It runs in every step and also runs when the machine already has Calamari. For machines that have AVs or other programs that slow down the execution of every powershell script, this can bloat deployment times when there are lots of steps.

Proposed solution

Only run the pre-check script a single time if Calamari does not exist.

Links

Internal discussion: https://octopusdeploy.slack.com/archives/CNHBHV2BX/p1664963114954029

N-lson avatar Oct 18 '22 09:10 N-lson

After profiling some deployments I found Octopus.FunctionAppenderContext.ps1 is written for every step and opened 16 times per step resulting in a lot of disk I/O. In the profile I captured, it took ~4s to write then read and execute the script. It was almost 2 minutes lost to just this operation for a single node which adds up to tens of minutes for a full cluster deployment.

cdhunt avatar Apr 04 '24 19:04 cdhunt