# openHistorian: Instance configuration issue related disk space management

**URL:** <http://discussions.gridprotectionalliance.org/t/openhistorian-instance-configuration-issue-related-disk-space-management/1290>\
**Category:** openHistorian\
**Created:** [July 25, 2024, 5:47pm UTC](http://discussions.gridprotectionalliance.org/t/openhistorian-instance-configuration-issue-related-disk-space-management/1290 "2024-07-25T17:47:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricardlira](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ricardlira/32/1314_2.png) [@ricardlira](http://discussions.gridprotectionalliance.org/u/ricardlira)\
**Post date:** [July 25, 2024, 5:47pm UTC](http://discussions.gridprotectionalliance.org/t/openhistorian-instance-configuration-issue-related-disk-space-management/1290/1 "2024-07-25T17:47:43Z")

</div>

Hello GPA team,

We are encountering malfunction issues with openHistorian disk management function.

We’ve been experiencing difficulties with the following parameters: AutoRemoveOlderFilesBeforeFull, DesiredRemainingSpace, MaximumArchiveDays, and AutoRemoveOldestFilesBeforeFull. Despite our configuration attempts, the system is not behaving as expected in terms of file management and removal. The files are not being removed leading to disk saturation.

We’ve tried the following connection string to configure the Historian Instance:

_“ArchiveDirectories=\172.25.201.110\export\SSH\_EAHw\FJDH\Archive; AutoRemoveOlderFilesBeforeFull = yes; DesiredRemainingSpace = 925; MaximumArchiveDays = 60; AutoRemoveOldestFilesBeforeFull=True”_

However, the expected file removal behavior is not occurring. The files are being stored correctly but the Auto Removal rules are not being applied. Could you please provide guidance on how to correctly set up these parameters to achieve the desired file management behavior? Examples? Documentation?

Any insights or troubleshooting steps you can share would be greatly appreciated.

OH version is: 2.8.383

 ![image](http://discussions.gridprotectionalliance.org/uploads/default/original/2X/4/4d9c785d7c6ccf8d3c6991ceef015f29902530c9.png)

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [July 25, 2024, 6:06pm UTC](http://discussions.gridprotectionalliance.org/t/openhistorian-instance-configuration-issue-related-disk-space-management/1290/2 "2024-07-25T18:06:02Z")

</div>

Here is a good summary:  
[Limit Total Archive Days · GridProtectionAlliance/openHistorian Wiki (github.com)](https://github.com/GridProtectionAlliance/openHistorian/wiki/Limit-Total-Archive-Days)

Note that `DesiredRemainingSpace` is in units of Gigabytes and indicates when the openHistorian will consider the disk to be “full” - your setting says to leave about 1.1 Terabytes of data on the drive, is that desired?. Generally, this only affects the archive directories, not the working directory, so if all archive directories are considered “full”, then data will back up into working directory unless other data removal options are in force.

I would recommend something like the following (assuming leaving 5GB free is sufficient here):

`ArchiveDirectories=\172.25.201.110\export\SSH_EAHw\FJDH\Archive; DesiredRemainingSpace = 5; MaximumArchiveDays = 60; EnableTimeReasonabilityCheck = true; ArchiveCurtailmentInterval=21600`

Note that `AutoRemoveOldestFilesBeforeFull` defaults to `True`, so need to respecify. Also, setting `ArchiveCurtailmentInterval` to `21600` to check disk space four times per day. You can set this smaller to check more often.

Additionally, make sure the user the Windows service logs in with actually has needed rights to “delete” files from the specified UNC path.

Thanks,  
Ritchie

---

<div class="post-metadata">

**Author:** ![ricardlira](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ricardlira/32/1314_2.png) [@ricardlira](http://discussions.gridprotectionalliance.org/u/ricardlira)\
**Post date:** [July 25, 2024, 6:32pm UTC](http://discussions.gridprotectionalliance.org/t/openhistorian-instance-configuration-issue-related-disk-space-management/1290/3 "2024-07-25T18:32:24Z")

</div>

Thanks for the guidance. The _DesiredRemainingSpace = 925_ was just a test to see if the parameter would be respected. Indeed we later reduced to a 5 GB. We will proceed testing as per your advice.
