Resource quantity calculations

The buffer manager will periodically calculate the following:

  • Contingency Reserve (C) calculated from the percentage set with the environment variable from Helm

  • Total Capacity (T) of the volume mounted, from the environment variable SDP_BUFFERMANAGER_TOTAL_CAPACITY or from the disk itself if this variable is unset..

  • Orphaned Data (O) is then calculated as:

O = Total used on disc - sum (size of all folders on disk of each processing block which still has a resource allocation)

The volumes free space is then calculated as F = T - O - C, and published on the quantity attribute on the resource.

Configuration database resource

Other SDP components can query the configuration database to retrieve the current capacity and free space of the capacity buffers. The information is periodically updated and can be accessed from the resource entry in the configuration database, as shown in the example below:

/resource/capacity-buffer-storage:test-pvc = {
    "information": {
        "contingency-reserve": 10,
        "orphaned-data": 0,
        "total-capacity": 25600
    },
    "instances": [],
    "key": {
        "kind": "capacity-buffer-storage",
        "name": "test-pvc"
    },
    "quantity": 23040,
    "tags": []
}