Faster deletes with Orthanc delayed deletion

Large study deletions in Orthanc can hold up the server while files are removed one by one. This page explains how to decide on delayed deletion, how to configure and verify it, and what to confirm before relying on it.

On this page

Why Orthanc deletes of large studies block the server and when faster deletes matter

If deleting a large study stalls your Orthanc server, Faster deletes with Orthanc delayed deletion is the approach to evaluate first. The cost sits in the removal itself: deleting a study means removing every DICOM file that belongs to it, and the Orthanc Book's scalability FAQ notes that removing many files is expensive, especially on HDDs. When that work runs in the same request path as the API call, users and automated workflows wait for it, and other operations can queue behind it. The same FAQ cites a user report of a 20 times speedup after moving from HDD to SSD, which shows how much the storage medium shapes the outcome.

Teams usually need this when the archive is large and deletions are routine rather than rare. Typical triggers include retention or purge jobs that remove many studies in one run, anonymization or research workflows that create and discard copies, and cleanup after failed or duplicate imports. Before you act, confirm with your own measurements whether the stall comes from file removal or from the index, because the fix differs. Record the storage type behind the archive, the number of instances per study you usually delete, and whether deletes overlap with ingest or retrieval peaks.

Delayed deletion moves the file removal out of the request path into a background queue, so the API call returns sooner and the server can keep serving clients while the files are cleared. That trade-off has a cost: disk space is reclaimed later, and the queue must be watched so it does not grow faster than it drains. Plan for that lag in capacity reports and in any process that expects space to free immediately. Confirm with the plugin documentation which Orthanc versions and database setups it supports before you design around it.

How the Delayed Deletion plugin queues and throttles file removal

Delayed Deletion moves file removal off the request path and paces it against other work. The cards below cover the parts of that behavior to understand and verify before you rely on it for large studies, from the queue itself to what a user sees after a delete is accepted.

The deletion queue

Instead of removing every file during the delete request, the plugin places the removals in a queue and works through them later. For a large study, this is what keeps the API call from waiting on hundreds of thousands of file operations. Confirm in the plugin documentation for your version which requests are queued, which are not, and whether a single study or a batch of studies enters the queue as one unit.

Throttling so other work continues

The queue is paced so that file removal does not starve ingest, C-STORE, queries and viewer requests of disk and CPU time. Check which throttle settings the plugin exposes, their names and defaults, and how they behave under load. Test with a realistic deletion backlog running alongside a normal read and write workload before you set these values in production.

What users see after acceptance

A delete accepted by the plugin does not mean the files are already gone from disk. Confirm whether the study disappears from queries, the REST API and Orthanc Explorer 2 immediately, or only after the queue reaches it. Your clinical and support staff need to know which behavior applies, so that a study still visible on disk is not mistaken for a failed deletion.

Queue persistence across restarts

Find out whether pending deletions survive a restart of the Orthanc process, a container recreation or a server reboot, and whether they resume or are dropped. This affects whether a maintenance window can safely interrupt a backlog. Confirm the answer against the documentation for your plugin version, then verify it in a staging environment by stopping Orthanc during an active backlog.

Scalability FAQ

Monitoring the backlog

Decide how you will see the queue length and whether deletions are still progressing. Confirm which log messages, metrics or endpoints the plugin provides, and set an alert on a backlog that stops shrinking. Without this signal, a stalled queue looks the same as a finished one to the people waiting for disk space to recover.

Configuration options and when each fits

This table compares immediate deletion, the Delayed Deletion plugin and the delayed deletion feature of Advanced Storage across the factors that decide between them. Read each row against your own instance count, database and disk type, then confirm the exact setting names in the plugin reference before you change anything.

OptionWhat it doesDatabase and deployment fitWhen to choose it
Immediate deletion (default)Removes files from the storage area during the delete request, so the API call waits for the work to finish.Works with the default index and single-instance setups. Long waits are most likely with large studies on HDDs.Small archives, SSD-backed storage, or when removals must be final before the call returns.
Delayed Deletion pluginQueues deleted files and removes them later in the background, with throttling so deletion does not starve other work.Listed as an official plugin. Confirm which index back ends and Orthanc versions it supports in the plugin reference.Large studies on HDD-backed storage where user-facing deletes are slow and the archive uses a supported setup.
Advanced Storage delayed deletionUses the delayed deletion feature of the Advanced Storage plugin, which also handles multiple storage areas and folder paths.Carries database version restrictions. Check the Advanced Storage page for which index databases and versions apply before planning.Archives that already use Advanced Storage for multiple disks or readable paths, and where the database version is confirmed to be supported.
Queue and throttling settingsControl how many files are removed per batch and how the background work is paced. Setting names and defaults vary by plugin version.Tune against your I/O capacity. Too aggressive pacing can slow viewers and ingest on the same disks.Ask for the key list from the plugin reference for your version, then test on a copy of the archive before production.
Single-instance deploymentOne Orthanc process owns the queue and the storage area, so ordering and recovery are simpler to reason about.Confirm restart behavior: whether queued deletions resume after a crash or restart.Smaller hospital archives or sites where one server handles all traffic.
Multi-instance deploymentSeveral Orthanc instances share one database. Each must see the same delayed work, and storage access must be consistent across them.Since Orthanc 1.9.2 with PostgreSQL or MySQL plugins 4.0, instances can share a database. Confirm whether the chosen deletion option supports shared queues.Horizontally scaled or highly available setups, after testing that deletion work is not duplicated or lost on failover.

How a delete request moves from REST call to file removal

The flow starts when a client sends a delete request to Orthanc's REST API. Orthanc removes the study from its index first, so the study disappears from queries straight away, and the files are queued for removal. A throttled background worker then deletes those files from the storage backend. The time the worker takes depends mostly on whether the storage is an HDD or an SSD, because removing many files is expensive on spinning disks. Check the queue length and storage type when deletes lag, and treat this diagram as illustrative of the general pattern rather than an exact internal design.

Illustrative flow: the index update returns first, file removal follows later from a queue.

Setting up delayed deletion step by step

This sequence takes a team from confirming its Orthanc build to proving that large study deletions return quickly and drain from the queue without disrupting live traffic. Each step ends with a check you can record before moving on.

  1. Confirm the Orthanc version and plugin build

    Record the Orthanc core version and the build of the Delayed Deletion plugin you intend to use, and confirm that the two are compatible according to the plugin page. Check the release notes for the core version you run, since Orthanc 1.13.0 (released on 2026-08-15) reworked storage-area access and parsing, and confirm how that affects your plugin. Your check is a written record of both versions, the operating system or Docker image, and the plugin source. Confirm these with the Orthanc Book and your own environment rather than assuming a match.

  2. Choose the storage plugin and database back end

    Decide which storage area and index database Orthanc will use, because the delayed deletion behavior depends on that combination. Ask whether your current setup uses the built-in SQLite index or a database plugin, and whether the storage area is local disk or object storage. Confirm in the plugin documentation which storage and database combinations are supported before you install anything. Your check is a one-page decision record naming the index database, the storage area, and the reason for each choice.

  3. Install and enable the plugin in configuration

    Install the Delayed Deletion plugin build that matches your Orthanc version on a non-production instance, then enable it in the Orthanc configuration file. Exact configuration keys and the location of the plugin file come from the plugin page, so copy them from there rather than from memory. Restart Orthanc and confirm that the plugin loads by checking the startup log and the system information returned by the REST API. Your check is a startup log line showing the plugin loaded without errors.

  4. Set queue and throttling options

    Set the queue and throttling options that control how deleted files are processed in the background, using the keys listed on the plugin page. Start with conservative values on a test instance so that you can observe the effect before changing them. Document each value, the reason for it, and the disk type it runs on, since the Orthanc Book notes that removing many files is expensive, especially on HDDs. Your check is a saved configuration file with the chosen values and a note on each one.

  5. Run a test delete on a non-production study

    Choose a study that holds no clinical value and that is copied from production data or created for testing, then delete it through the normal REST or Orthanc Explorer path. Note the time the request returns and confirm that Orthanc responds without waiting for the files to be removed from disk. Repeat the test with a larger study if your archive contains one, and compare the two responses. Your check is a record of response times, study identifiers, and confirmation that the study no longer appears in queries.

  6. Verify the queue drains and review the logs

    Watch the delayed deletion queue until it is empty, and confirm that the files for the test study are gone from the storage area. Review the Orthanc log for errors, warnings, or repeated retries during the drain. Check disk usage and I/O on the host during the process, since throttling settings that are too aggressive can lengthen the drain while settings that are too loose can affect other workloads. Your check is an empty queue, matching file counts in storage, and a clean log for the test window.

  7. Confirm behavior with multiple instances before production

    If your deployment runs several Orthanc instances against one database, repeat the test with all instances running and confirm which instance processes the queue and whether that behavior matches your expectations. Check the scalability guidance on the Orthanc Book for shared-database setups before you rely on this behavior in production. Ask your Orthanc Team or plugin support contact to confirm any multi-instance detail you cannot verify in the documentation. Your check is a written result for the multi-instance test, signed off by the team that owns the archive.

What changes with several Orthanc instances on one database

Since Orthanc 1.9.2 with PostgreSQL or MySQL plugins 4.0, several instances can read and write the same index. A delete accepted by one instance still has to leave every instance and the shared storage in agreement, so the questions below decide whether queued file removals are safe in a cluster.

Which instance removes queued files

A delayed delete is a queue of file removals, and in a cluster it is not obvious which instance drains it. If each instance runs its own queue, two instances may try to remove the same file or one may skip work the other already did. Confirm whether the queue lives in the shared database or in each instance's local state, and whether only one worker processes it at a time. Ask the vendor for the exact behavior in your plugin version before you rely on it.

Scalability FAQ

Restart and pending deletes

A restart can happen in the middle of a large deletion. Find out whether pending removals survive a restart of the instance that accepted them, and whether they resume on another instance if that node is gone. A study that is missing from the index but still has files on disk, or the reverse, is the failure to test for. Run a planned restart during a bulk delete in a test environment and reconcile the index against the file system afterward.

How shared storage is accessed

Every instance that deletes files must reach the same storage location with the same permissions and the same path layout. Check whether the storage is a shared network file system, an object store, or local disks that only one node can see. Mismatched mounts or stale file handles can make a delete succeed on one node while the file stays on another. Document which node owns each storage path and confirm the mount options on every node.

Delete requests across load balancers

A load balancer may send a delete request to any instance, and a client may retry if it gets no response. Confirm that a repeated request for the same study is accepted once and does not queue the same removals twice. Check how the REST delete call reports progress when the work finishes on a different node than the one that answered. Test retries with a timeout set on the client side to see what the index shows afterward.

Throttling across the cluster

Throttling set on one instance does not automatically limit the load another instance places on the same disks. Decide whether the rate limit must be applied per node or per storage system, and document the setting on each node. If the queue runs on several nodes at once, the combined removal rate can exceed what the storage handles well, especially on HDDs. Measure disk latency during a bulk delete on a staging cluster before setting production limits.

Versions and upgrades

All instances on one database should run compatible Orthanc and database plugin versions while a delete queue exists. Confirm that the plugin version on every node supports the same queue format before a rolling upgrade. Plan the upgrade so that no node starts draining a queue written by a version another node cannot read. Use a staging copy of the database to rehearse the rolling order and record the result.

Multi-instance support from
1.9.2

How HDD versus SSD storage changes delete times

The storage medium under Orthanc often matters more to delete times than the delete setting itself. The Orthanc Book explains that deleting large studies is slow because removing many files is expensive, and that this cost is especially pronounced on spinning HDDs. A user report cited in the Orthanc Book scalability FAQ describes a 20 times speedup after moving the archive from HDD to SSD. Treat that figure as one user's experience on one setup, not a benchmark. It shows the direction of the effect, not the size of the gain you will see.

Because a single study can contain thousands of instance files, each removed file adds metadata work on the disk. On a spinning disk, that work is dominated by head movement and random access, so a long run of small deletions can stall ingest and retrieval while it completes. On an SSD, the same operations usually complete much faster, but the amount of gain depends on file counts, file sizes, filesystem type and how the disks are shared with other workloads. Ask your storage team whether the archive volume is HDD, SSD or a mix, and whether it sits behind a RAID controller, a network file system or a cloud volume, because each layer changes the answer.

Before you change storage, measure the delete times you have today. Pick a few representative studies of different sizes, record how long each deletion takes through the REST API and note the disk load during the run. Repeat the same test after any move to SSD, after changing the filesystem, and after enabling delayed deletion, so you can separate the effect of the medium from the effect of the queue. Keep the test set and the method fixed, and report the results with the file counts attached. That record also gives you the evidence to ask a hardware vendor or a partner for a sized quote rather than a guess.

Questions teams ask before changing how Orthanc deletes studies

Can our team set up Orthanc delayed deletion without outside help?

Yes, if your engineers already run Orthanc and can edit its configuration, test against a copy of real archive behavior, and roll back a change safely. The Delayed Deletion plugin is a configuration and operations task rather than a code project, but the risk sits in the details: how deletions are queued, how throttling interacts with your ingest and retrieval load, and how the queue behaves when more than one Orthanc instance shares the same database. Teams without recent Orthanc operations experience usually find the testing and validation work takes longer than the configuration itself. Ask whether your team has someone who has already changed storage behavior on a production archive.

How long does setup and testing take, and what drives that time?

The duration depends on the size of your archive, how many Orthanc instances share it, whether you already run PostgreSQL or another supported index database, and how much test coverage you need before a production change. Testing the deletion queue under realistic study sizes, checking throttling against your peak retrieval and storage traffic, and confirming monitoring and rollback steps usually take more time than the configuration change. Ask any partner for a written timeline that lists each test scenario and the environment it runs in, rather than a single estimate.

What does the work need from our team before it starts?

You will need administrative access to the Orthanc hosts and their storage paths, the database connection details and a backup you can restore, and a non-production environment with a representative dataset. Test data matters: deletion behavior depends on study count, instance count and file size, so a small sample rarely reproduces production timing. Your team should also confirm who approves changes to the archive, which monitoring tools will record queue length and deletion timing, and how deleted files are verified afterward. Ask your partner to list these inputs in the written scope so gaps are found before work begins.

Does moving Orthanc storage to SSDs solve slow deletes on its own?

Not necessarily. The Orthanc Book notes that deleting large studies is slow because removing many files is expensive, especially on HDDs, and cites a user report of a 20 times speedup after moving from HDD to SSD. That is a useful signal, but it reflects one user's environment. Faster media reduces the per-file cost, yet deletions of very large studies can still block other work if they run in the foreground, and an SSD tier costs more per terabyte than HDD capacity. Confirm the effect on your own workload with a timed test before buying hardware, and consider whether a deletion queue is still needed after the upgrade.

What does a DeployOpen fixed-scope engagement for delayed deletion cover?

A DeployOpen engagement is fixed-scope, so the scope, deliverables and timeline are agreed in writing before work starts. For this topic, a typical written scope would cover reviewing your current storage and database layout, configuring the Delayed Deletion plugin or the alternative you choose in your own infrastructure, testing queue and throttling behavior with your data, documenting how multiple instances are handled, and handing over operating notes. Items outside the agreed scope, such as hardware purchases or changes to unrelated storage plugins, would be quoted separately. A quote follows from the written scope.

When should we pick the Advanced Storage plugin instead of Delayed Deletion?

Choose by the features you need, not by the deletion problem alone. The Advanced Storage plugin also spreads an archive across several disks, defines readable folder paths, indexes existing folders and delays deletions, but it carries database version restrictions that you should check before committing. Delayed Deletion is narrower and fits teams that mainly need deletions to stop blocking Orthanc. Confirm plugin version compatibility with your Orthanc release and database, and test both options against your archive layout before deciding.

What are the main risks of changing deletion behavior on a live archive?

The main risks are deleting files too early, leaving orphaned files that consume storage, letting the queue grow faster than it drains, and throttling that slows clinical retrieval. Each risk depends on how Orthanc records deletions and how your storage is mounted, so review those first. Ask for a rollback plan that restores the previous configuration, a check that compares database records with files on disk after a test run, and alerts on queue length. Confirm these controls with your own change process before the first production change.

Security and operational considerations for deletion queues

A delayed deletion queue removes data on a schedule, so the routes that trigger deletions, the scripts and exports that can touch files, and the people who can see queue state all matter. The cards below cover the access settings that guard deletion routes, the routes that should stay off, and the monitoring and audit checks to plan before a queue goes live.

Lock down remote access first

Orthanc accepts HTTP connections only from localhost by default. If RemoteAccessAllowed is enabled for a deletion-heavy setup, the Orthanc security FAQ says AuthenticationEnabled should be true, with users defined in RegisteredUsers. Check which accounts can call REST delete routes, and remove shared or unused credentials before the queue starts processing large studies.

Security FAQ

Put HTTPS behind a reverse proxy

The security FAQ recommends HTTPS and a reverse proxy for any Internet exposure. Terminate TLS at the proxy, restrict which source networks can reach the Orthanc REST API, and confirm that delete requests are only accepted from your administrative tools. Ask your network team to test the proxy path with the same credentials your operators use.

Keep script and export routes disabled

The security FAQ warns that /tools/execute-script can let a malicious user run any system command, and that the export route can overwrite files. Both should stay disabled on a server that also runs a deletion queue, because a compromised session could otherwise remove or replace archived files outside the queue's controls. Verify this in the production configuration, not only in the template.

Record who requested each deletion

Before you rely on deletion audit trails, confirm with the vendor and your own test environment what Orthanc logs for each delete request, and what your reverse proxy and identity provider record. Plan an external log trail that links each deletion to a user, a study identifier and a time, so a removed study can be explained during an incident review or a patient access dispute.

Monitor queue depth

Track how many deletions are waiting in the queue and how quickly the queue drains. A growing backlog after a large cleanup can mean the storage is too slow for the current throttling settings, or that the instance is busy with other work. Set alert thresholds with your operators, and review them after each large cleanup window.

Watch for failed removals

A file that cannot be removed may leave orphaned data on disk or an index entry that no longer matches storage. Monitor failed removals in the Orthanc logs and your storage platform, and schedule reconciliation checks. Ask your vendor or partner how failures are retried, and who is responsible for clearing items that keep failing.

How DeployOpen scopes a delayed deletion change

A delayed deletion change starts with a review of how the current deletion path behaves in your archive, before any setting is changed. DeployOpen looks at which deletions are slow for your users, where the stored DICOM files sit (local HDDs, SSDs, or an object store), which Orthanc version and index database you run, and whether more than one Orthanc instance shares the same storage and database. The storage type and multi-instance layout usually decide which option is appropriate, so they are the first facts to document. The Orthanc Book's scalability FAQ is the natural reference for why large study deletions are expensive on HDDs, and the review checks whether your environment matches that pattern.

From that review, DeployOpen proposes a fixed-scope change and records it in writing before work starts. The written scope names the approach (for example the Delayed Deletion plugin or the Advanced Storage plugin, each with its own constraints), the configuration files and keys that will change, the study sizes and deletion patterns to be covered, the instances affected, the rollback steps, and the operator documentation to be delivered. Items that you must confirm include plugin compatibility with your Orthanc version and database plugin, the access your team grants to the test and production hosts, and who approves the production change window. A quote follows from the written scope, so the cost components (review, design, test environment, configuration, and handover) are visible to your procurement team before commitment.

Testing uses representative studies rather than synthetic files, with deletions of the sizes your users actually request, measured on the storage tier you will run in production. DeployOpen records the deletion queue behavior, throttling effects on ingest and retrieve traffic, and any change in disk activity, then supports the result after handover. Support covers checking the queue during normal operations, reviewing logs after Orthanc upgrades, and retesting when storage or the Orthanc version changes. Ongoing support is available as a retainer, and it is priced separately from the initial fixed-scope work.

How DeployOpen works on this

DeployOpen plans and implements Orthanc deletion behavior inside your own infrastructure, starting from how your archive is stored and how often large studies are removed. The work is scoped in writing before any change is made, then tested, documented and handed over so your team can run it.

How we scope

  • Review how deletions run today, including study sizes, deletion frequency and the storage media holding the DICOM files.
  • Confirm which Orthanc version, database plugin and storage layout are in use before choosing between the Delayed Deletion plugin and Advanced Storage.
  • Agree in writing which deletion behavior, throttling settings and multi-instance checks are in scope, with timelines and deliverables set before work starts.

How we build

  • Configure the Delayed Deletion queue and throttling on a non-production copy of your archive first, then compare behavior against your deletion workload.
  • Test deletions with multiple Orthanc instances sharing one database to confirm queued work is handled as your architecture expects.
  • Document the storage media assumptions, including how HDD and SSD performance changes deletion time, so sizing decisions are recorded.

How we hand over

  • Deliver configuration files, change records and a written runbook covering queue monitoring, throttling adjustments and recovery steps.
  • Walk your operations and storage teams through the deletion queue, the logs to check and the settings that are safe to change.
  • Provide evidence of tested deletion scenarios so your compliance and security reviewers can see how removals behave.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover, covering Orthanc version changes.
  • Re-test deletion behavior when you upgrade Orthanc, change database plugins or move storage to different media.
  • Ask for a quote that separates one-time build work from any recurring retainer so the cost of each part is clear.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.