Resolution
This issue usually occurs when administrators first adjust their Default Retention policies. We recommend following our general best practices. Depending on the time period between the default policy and the implementation of a personalized policy, it's best to start as far out as you can and gradually scale back to reduce strain on Octopus and SQL Server.
Scope: when this is the right article
If your Self-Hosted Octopus Server is maxing out your CPU and memory utilization, impacting production or crashing while applying your retention policies, this is the right article for you.
Symptom
- Octopus Server CPU or memory stays high while the Apply retention policies task runs.
- The Octopus Web Portal is slow or unresponsive, and retention tasks run for hours, time out, or get cancelled.
- The spikes repeat on the retention schedule.
To confirm retention is the cause, go to Tasks, filter by Apply retention policies, and compare the start and end times with your server's memory graph. If memory climbs while retention runs and drops when it ends, retention is the likely cause.
Cause
During the initial swap between the Default Policy and a personalized Retention Policy, most people will select their intended policy, which will prune significantly more items than a regular retention run would. This can also occur as a scaling issue if the number of items to be pruned within a set period has grown exponentially over time.
Diagnosis and fix
Scenario 1: This is the first time running retention, or there's a dramatic adjustment of retention.
General Recommendations
-
Reduce your retention policy slowly if you're seeing a significant performance impact. For example, if you have a year of history built up, start at 51 weeks instead of 11 months. Then decrease it in steps, evaluating after each one. See tightening retention policy settings.
-
The retention tasks run about every four hours by default. You can run them immediately if needed, but run the first retention task after a policy change during off-hours.
-
Check your Octopus Server version before you add resources. Builds before 2026.1.11539, and 2026.3 builds before 2026.3.4001, have a known defect where retention memory keeps growing regardless of how much RAM the server has. Upgrade instead. See Octopus Server memory usage climbs very high during retention processing. Scaling up only buys time until the task finishes.
Scenario 2: This is happening well after implementing a new Retention Schedule
General Recommendations
-
Review your existing SQL Maintenance plans and existing jobs relating to that; we have some general recommendations in Octopus performance guidance: SQL maintenance.
-
If you're running your Octopus Server and your SQL Server on the same VM or Server, you might need to separate them to reduce the number of factors that could impact performance during retention.
-
If all else fails, your SQL Server might be under-provisioned for your use case, especially if you're scaling significantly. Please review our scaling guidelines and open a support ticket if this behavior continues after we've made our recommendations.
Verify
You should be able to verify if the recommendations in this article work properly by monitoring your system resource utilization during retention tasks. If it's under control, it should no longer impact you between retention tasks.