Specifying when retention policy is run

So currently Octopus seems to run retention policies after copying the packages content.

Is it possible to add a step that says, if you’re going to run retention policies, run them now.

Many thanks.

Josh

Hi Josh,

Thanks for getting in touch!

Unfortunately not. Retention policies will be applied after the deployment finishes.

Can you tell me why you’d want to run them at any other time? They’re only used to clean up unused deployment resources.

Damo

Hi Damo,

The reason is to minimize downtime. The retention policies can take a bit of time to run. For example, if our process is:

Stop Application Pool
Deploy
Start Application Pool

Retention policies may run after deploy, meaning the application will be stopped during the retention policy.

Ideally I’d want

Stop Application Pool
Deploy
Start Application Pool
Run Retention Policies

This would minimize the amount of time the application pool is stopped.

Cheers,

Josh

Hi Josh,

Thanks for this, I understand your situation. I can confirm that the retention policy runs after the last package step (at that point you have all the new files and don’t need old ones).

We’ve always considered the retention policy process to be quite quick, and in our experience it has been. If that’s not the case, it’s definitely something we should look at.

Do you have any metrics around this process in your environments? Server Logs from a deployment with a retention cleanup would be really useful, as would your actual retention policy rules.

Damo

Hi Damo,

One example of a retention policy taking a bit of time is when running on a low powered vm, I know that it’s not a huge amount of time but I’ve seen it take up to 2 minutes.

Info 10:56:52
Info 10:57:54
Retention processing complete

Cheers,

Josh

Hi Josh,

What is the retention policy time compared to the full deployment time? I think we would be concerned if it was 5% or more of the overall deployment time.

There are a few factors that we need to consider that would add to the time, such as how many deployments and projects that Tentacle has had (as we have to read through a deployment journal). And how many files it needs to clean up.

I’m reading into your response that on higher powered VMs it is not as slow, and due to what it has to do this would make sense to be slower on a lower powered VM. However in that case, I’d also expect the entire deployment process to be slower as well.

Damo

Hi Damo,

The deploy time is around 20 minutes. The retention policy is slow on just one of the servers (an under powered VM). We should probably just upgrade the vm.

Cheers,

Jodh