changeset 861:c3e169fe22da

delayed deletion
author Alain Mazy <am@osimis.io>
date Thu, 30 Jun 2022 17:59:23 +0200
parents 3e8a3a900e9e
children 71e339681c6b
files Sphinx/source/faq/scalability.rst Sphinx/source/plugins.rst Sphinx/source/plugins/delayed-deletion-plugin.rst
diffstat 3 files changed, 78 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Sphinx/source/faq/scalability.rst	Thu Jun 30 16:48:08 2022 +0200
+++ b/Sphinx/source/faq/scalability.rst	Thu Jun 30 17:59:23 2022 +0200
@@ -387,12 +387,8 @@
 <https://groups.google.com/g/orthanc-users/c/1lga0oFCHN4/m/jF1inrc4AgAJ>`__
 a 20 times speedup by switching from HDD to SSD).
 
-If switching from HDD to SDD is not applicable, it is possible to
-create an :ref:`storage area plugin <creating-plugins>` that delays
-the actual deletion from the filesystem. The plugin would maintain a
-queue (e.g. as a SQLite database) of files to be removed. The actual
-deletion from the filesystem would be done asynchronously in a
+If switching from HDD to SDD is not applicable, you may also use 
+the :ref:`Delayed Deletion plugin <delayed-deletion-plugin>` .
+The plugin would maintains a queue of files to be removed. The actual
+deletion from the filesystem is done asynchronously in a
 separate thread.
-
-We are looking for funding from the industry to implement such a
-plugin.
--- a/Sphinx/source/plugins.rst	Thu Jun 30 16:48:08 2022 +0200
+++ b/Sphinx/source/plugins.rst	Thu Jun 30 17:59:23 2022 +0200
@@ -71,6 +71,8 @@
    plugins/authorization.rst
    plugins/housekeeper.rst
    plugins/orthanc-explorer-2.rst
+   plugins/delayed-deletion-plugin.rst
+
 
 .. _plugins-uclouvain:
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Sphinx/source/plugins/delayed-deletion-plugin.rst	Thu Jun 30 17:59:23 2022 +0200
@@ -0,0 +1,72 @@
+.. _delayed-deletion-plugin:
+
+
+Delayed deletion plugin (new in Orthanc 1.11.1)
+===============================================
+
+This page describes the **official sample plugin** that performs
+delayed deletions of storage files.
+
+On some file systems, the deletion of files can be quite long and therefore,
+a ``DELETE`` request on a study with thousands of instances can last minutes.
+
+The Delayed deletion plugin handles file deletion asynchronously by pushing
+the files to delete into a queue that is handled asynchronously.
+This queue is stored in a SQLite DB stored on disk which allows the plugin
+to resume deletions if Orthanc is stopped/restarted while deleting files.
+
+
+Configuration
+-------------
+
+.. highlight:: json
+
+Here's a sample configuration section for this plugin with its default values::
+
+  {
+    "DelayedDeletion": {
+
+      // Enables/disables the plugin
+      "Enable": false,
+
+      // Delay (in milliseconds) between deletion of 2 files
+      // This avoids overloading Orthanc disk with the deletion
+      // of files and leaves room for other operations.
+      // '0' means no throttling.
+      "ThrottleDelayMs": 0,
+
+      // Force the path of the SQLite DB
+      // By default, this value is generated by the plugin base on
+      // the "StorageDirectory" and "DatabaseServerIdentifier"
+      // configurations.
+      // If running multiple Orthanc on the same storage, make
+      // sure that they use different "Path" for the DelayedDeletion DB
+      // "Path": "/my/path/delayed-deletion.db"
+    }
+  }
+
+Working with multiple Orthanc instances
+---------------------------------------
+
+When running multiple instance on the same DB (e.g a PostgreSQL DB), each
+Delayed Deletion plugin will maintain its own list of files to delete and
+store it in its own SQLite DB.  To make sure each instance has its own
+DB, the plugin uses the ``DatabaseServerIdentifier`` configuration to 
+generate the name of the SQLite DB.
+
+
+
+Status
+------
+
+You can get a progress status of the plugin by calling the ``/delayed-deletion/status`` API route.
+
+
+Compilation
+-----------
+
+This plugin is part of the Orthanc core repository and is included in the Orthanc makefile.  
+It is compiled with Orthanc itself and is distributed together with Orthanc binaries.
+
+
+