How to configure deletion of least recently accessed studies

vrindanayak edited this page Oct 11, 2016 · 6 revisions
Clone this wiki locally

Configuration for Deletion

You may either

  • create a LDIF file (e.g.):

    version: 1
    dn: dcmStorageID=dcm4chee_store,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
    changetype: modify
    add: dcmDeleterThreshold
    dcmDeleterThreshold: 500MB
    -
    
    dn: dcmStorageID=dcm4chee_store,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
    changetype: modify
    add: dcmDeleterThreshold
    dcmDeleterThreshold: 1[hour=10-11 dayOfWeek=*]100MB
    -
    

    and import it to the LDAP Server by using the ldapmodify command line utility.

  • or use the Add Attribute... and Add Value... function of Apache Directory Studio to add attributes on Storage Level (e.g.: dcmStorageID=dcm4chee_store) in the Archive Configuration.

One may refer to Storage Descriptor to understand the description of attributes.

Above example shows that one may add one or more deleter thresholds depending on one's application. Value of 2nd dcmDeleterThreshold is explained below :

  • priority = 1
  • size = 100MB
  • schedule = timings between 10a.m. to 11a.m. any day of the week

Also, you may either

  • create a LDIF file (e.g.):

    version: 1
    dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
    changetype: modify
    add: dcmPurgeStoragePollingInterval
    dcmPurgeStoragePollingInterval: PT5M
    -
    
    dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
    changetype: modify
    add: dcmPurgeStorageFetchSize
    dcmPurgeStorageFetchSize: 100
    -
    
    dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
    changetype: modify
    add: dcmDeleteStudyBatchSize
    dcmDeleteStudyBatchSize: 10
    -
    

    and import it to the LDAP Server by using the ldapmodify command line utility.

  • or use the Add Attribute... and Add Value... function of Apache Directory Studio to add attributes on Device Level (e.g.: dicomDeviceName=dcm4chee-arc) of the Archive Configuration.

One may refer to Archive Device to understand the description of attributes.

Refer ISO-8601 Duration format for more know-how on Durations.

Below is log snippet for the same (i.e. on auto deletion after the configured intervals)

2016-01-26 15:04:49,021 INFO  [org.dcm4chee.arc.delete.impl.PurgeStorageScheduler] (EE-ManagedScheduledExecutorService-default-Thread-2) Successfully delete Study[pk=7919, uid=2.16.124.113543.6004.101.103.20021117.192613.1, id=2K-ANATM] on file:///srv/retrievecache from database
2016-01-26 15:04:49,034 INFO  [org.dcm4chee.arc.delete.impl.PurgeStorageScheduler] (EE-ManagedScheduledExecutorService-default-Thread-2) Successfully delete Location[pk=1271475, systemID=dcm4chee_store, path=2016/01/26/B4E078D8/EBDDF01B/F54E1477, tsuid=1.2.840.10008.1.2.4.80, size=4150696, status=TO_DELETE] from file:///srv/retrievecache
2016-01-26 15:04:49,040 INFO  [org.dcm4chee.arc.delete.impl.PurgeStorageScheduler] (EE-ManagedScheduledExecutorService-default-Thread-2) Successfully delete Location[pk=1271418, systemID=dcm4chee_store, path=2016/01/26/B4E078D8/EBDDF01C/B5322463, tsuid=1.2.840.10008.1.2.4.80, size=3371384, status=TO_DELETE] from file:///srv/retrievecache
2016-01-26 15:04:49,045 INFO  [org.dcm4chee.arc.delete.impl.PurgeStorageScheduler] (EE-ManagedScheduledExecutorService-default-Thread-2) Successfully delete Location[pk=1271398, systemID=dcm4chee_store, path=2016/01/26/B4E078D8/EBDDF01D/98A7DAE6, tsuid=1.2.840.10008.1.2.4.80, size=3406152, status=TO_DELETE] from file:///srv/retrievecache
2016-01-26 15:04:49,050 INFO  [org.dcm4chee.arc.delete.impl.PurgeStorageScheduler] (EE-ManagedScheduledExecutorService-default-Thread-2) Successfully delete Location[pk=1271478, systemID=dcm4chee_store, path=2016/01/26/B4E078D8/EBDDF01D/07A6CE9D, tsuid=1.2.840.10008.1.2.4.80, size=2734182, status=TO_DELETE] from file:///srv/retrievecache

Configuration for updation of Access time in Study table

You may either

  • create a LDIF file (e.g.):

    version: 1
    dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
    changetype: modify
    add: dcmMaxAccessTimeStaleness
    dcmMaxAccessTimeStaleness: PT5H
    

    and import it to the LDAP Server by using the ldapmodify command line utility.

  • or use the Add Attribute... and Add Value... function of Apache Directory Studio to add attributes on Device Level (e.g.: dicomDeviceName=dcm4chee-arc) of the Archive Configuration.

One may refer to Archive Device to understand the description of attributes.

Refer ISO-8601 Duration format for more know-how on Durations.

By setting this property system checks the difference between the current accessed time and this value (in above example set to 5 hours). If the difference is larger than the last study access time only then the access time in study table is updated. The benefit of setting this property is that, for eg. if a study has 10000 instances then the access time in study table is updated only once instead of 10000 times, which also saves the expensive db operations. The value of this property can be set as required by your application.