Skip to content

Commit 4f5be6c

Browse files
authored
Make disk usage health check threshold configurable (#9870)
1 parent a9b45ec commit 4f5be6c

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Added
2+
3+
- Made disk usage health check threshold configurable and updated documentation
4+
(<https://github.com/cvat-ai/cvat/pull/9870>)

cvat/settings/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,3 +792,6 @@ class REDIS_INMEM_DATABASES(IntEnum):
792792
)
793793

794794
USER_LAST_ACTIVITY_UPDATE_MIN_INTERVAL = timedelta(days=1)
795+
796+
# Health check settings
797+
HEALTH_CHECK = {"DISK_USAGE_MAX": int(os.getenv("CVAT_HEALTH_DISK_USAGE_MAX", 90))}

site/content/en/docs/administration/basics/installation.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,12 @@ MigrationsHealthCheck ... working
377377
OPAHealthCheck ... working
378378
```
379379

380+
Configuring Disk Usage Health Check
381+
382+
- `CVAT_HEALTH_DISK_USAGE_MAX`: This environment variable specifies the maximum allowed disk usage percentage
383+
for the volume where CVAT is installed.
384+
If the disk usage exceeds this threshold, the DiskUsage health check will fail.
385+
The value should be an integer representing a percentage (e.g., 90 for 90%). Read more about how to enable [health checks](#cvat-health-check-failed-because-of-too-low-free-disk-space).
380386
### Deploying CVAT behind a proxy
381387

382388
If you deploy CVAT behind a proxy and do not plan to use any of [serverless functions](#semi-automatic-and-automatic-annotation)
@@ -720,3 +726,29 @@ and restart docker:
720726
```shell
721727
docker compose -f docker-compose.yml -f docker-compose.https.yml up -d
722728
```
729+
730+
### CVAT health check failed because of too low free disk space
731+
732+
During CVAT startup, it is possible to get an error like this:
733+
734+
```
735+
health_check.exceptions.ServiceWarning: warning: <server name> 94.8% disk usage exceeds 90%
736+
```
737+
738+
This error means that there is not enough free disk space on the CVAT data storage volume.
739+
740+
By default, CVAT requires at least 10% free disk space. If you want to change the default value,
741+
it is possible to configure the required amount of free space used in such checks.
742+
743+
Set the environment variable:
744+
745+
```shell
746+
export CVAT_HEALTH_DISK_USAGE_MAX=90
747+
```
748+
749+
and add an extra environment variable to the `docker-compose.yml` file:
750+
751+
```yaml
752+
x-backend-env: &backend-env
753+
CVAT_HEALTH_DISK_USAGE_MAX: '${CVAT_HEALTH_DISK_USAGE_MAX:-90}'
754+
```

0 commit comments

Comments
 (0)