A fairly common issue that comes up in the support Discord relates to Lancache's cache drive running out of free space in one way or another, causing issues with the cache until some free space has been cleared. It is fairly easy accidentally have this happen via various scenarios:
Misconfiguration of volume mounts for /data/cache will end up writing cache files to the OS drive, which can eventually deadlock the whole system until some space is cleared.
Configuring a CACHE_DISK_SIZE that is larger than than the actual available disk space.
Sharing the Lancache cache disk with other applications, where even if CACHE_DISK_SIZE is correctly configured it is still possible to have other applications writing their own data, taking up space for the cache.
With the release of NGINX 1.19.5 a new parameter min_free has been added to proxy_cache_path which ensures that the specified amount of free disk space is always available. Details from the docs :
The special “cache manager” process monitors the maximum cache size set by the max_size parameter, and the minimum amount of free space set by the min_free (1.19.1) parameter on the file system with cache. When the size is exceeded or there is not enough free space, it removes the least recently used data.
Proposal
I propose the following changes:
Update monolithic to use the ubuntu:24.04 base image, so that a newer version of NGINX with min_free can be used.
Add support for min_free to monolithic, with a default of 100G free.
Allow overriding of default min_free value via environment variable.
Update related documentation, docker compose, etc.
Since this change will require updating several repos, I'm going to use this issue as a single issue to keep track of all of the related pull requests in one place. I will add the pull requests below as I get them created
Overview
A fairly common issue that comes up in the support Discord relates to Lancache's cache drive running out of free space in one way or another, causing issues with the cache until some free space has been cleared. It is fairly easy accidentally have this happen via various scenarios:
/data/cache
will end up writing cache files to the OS drive, which can eventually deadlock the whole system until some space is cleared.CACHE_DISK_SIZE
that is larger than than the actual available disk space.CACHE_DISK_SIZE
is correctly configured it is still possible to have other applications writing their own data, taking up space for the cache.With the release of NGINX 1.19.5 a new parameter
min_free
has been added to proxy_cache_path which ensures that the specified amount of free disk space is always available. Details from the docs :Proposal
I propose the following changes:
monolithic
to use the ubuntu:24.04 base image, so that a newer version of NGINX withmin_free
can be used.min_free
to monolithic, with a default of100G
free.min_free
value via environment variable.Testing
I've pushed up a copy of monolithic with the changes to [Dockerhub(https://hub.docker.com/repository/docker/tpill90/monolithic/tags). Use the tag
tpill90/monolithic:minfree
to test locally.Pull Requests
Since this change will require updating several repos, I'm going to use this issue as a single issue to keep track of all of the related pull requests in one place. I will add the pull requests below as I get them created