CACHEFILESD.CONF(5)
π CACHEFILESD.CONF(5) π
okay bestie, welcome to the manual page for /etc/cachefilesd.conf β that's the local file caching configuration file from the Cache Files Utilities, and we are gonna make it make sense, fr fr. π
β¨ SYNOPSIS β¨
This is the config file for cachefilesd, which can manage a persistent cache for a whole variety of network filesystems, using a set of files on an already-mounted filesystem as the data store. She's the blueprint, periodt. π
πΈ DESCRIPTION πΈ
This config file can hold a bunch of commands. Each one goes on its own line, no sharing, okay? Blank lines and any line starting with a # are comments and get yeeted immediately. Not me being selective, it's literally in the spec. π¦
The one and only mandatory command is:
dir <path>β says which directory holds the root of the cache. It may only be specified once per configuration file. That's it, that's the non-negotiable one. π
Every other command is optional, and there are a LOT of them:
secctx <label>β specify an LSM security context that the kernel will perform operations as when it accesses the cache. The default is to usecachefilesd's own security context. Files get created in the cache with the label of the directory you gave to thedircommand.brun <N>%bcull <N>%bstop <N>%frun <N>%fcull <N>%fstop <N>%β these six configure the culling limits. The defaults are 7% (run), 5% (cull) and 1% (stop) respectively. Peep the cache culling section below for the whole lore.
the commands starting with abare file space (block) limits, and the ones starting with anfare file count limits. b for block, f for files, iconic mnemonic behavior honestly.
tag <name>β gives FS-Cache a tag to use when telling multiple caches apart. You only need this if more than one cache is gonna be in use. Default is"CacheFiles".culltable <log2size>β sets the size of the tables that hold the lists of cullable objects in the cache. Bigger number = faster and smoother culling when there are a ton of objects in the cache, but it also eats more memory fromcachefilesd. It's given as the log2 of the size you actually need β so12means a table of4096entries and13means8192entries. Permissible values are between12and20, and20means1048576entries. Default is12.nocullβ disables culling entirely. Culling and building the cull table do take up a certain amount of a system's resources, which may be undesirable, so supplying this option turns off all culling activity. The cache will just keep building up to the limits that were set and won't be shrunk β except by removal of out-dated cache files. so like, it stays big. that's the deal. πresume_thresholds <blocks> <files>β says how many blocks or files the kernel should let go of before the daemon should resume from culling table scan suspension. Scanning to refill the cull table gets suspended when every object in a cache is pinned by a live network filesystem in the kernel and there's nothing to cull. Either value can be-to say that threshold should be ignored. flexible queen. π«Άdebug <mask>β a numeric bitmask that controls debugging in the kernel module. Default is zero (all off). These values can be OR'd into the mask to collect various info:1β turn on trace of function entry (_enter()macros)2β turn on trace of function exit (_leave()macros)4β turn on trace of internal debug points (_debug())
This mask can also be set through /sys/module/cachefiles/parameters/debug.
π§ EXAMPLES π§
As an example, consider the following:
dir /var/cache/fscache
secctx cachefiles_kernel_t
tag mycache
brun 10%
bcull 7%
bstop 3%
secctx system_u:system_r:cachefiles_kernel_t:s0
So what's happening here? This places the cache storage objects in a directory called "/var/cache/fscache", names the cache "mycache", and permits the cache to run freely as long as there's at least 10% free space on /var/cache/fscache/. It starts culling the cache when the free space drops below 7%, and stops writing new stuff into the cache if the amount of free space drops below 3%. If the cache gets suspended, it won't reactivate until the amount of free space rises again to 10% or better. self-healing behavior, we love to see it. β¨
Furthermore, this tells the kernel module the security context it should use when accessing the cache (SELinux is assumed to be the LSM in this example). In this case, SELinux would use cachefiles_kernel_t as the key into the policy. π
π CACHE CULLING π
The cache may need culling occasionally to make space. That involves discarding objects from the cache that have been used less recently than anything else. Culling is based on the access time of data objects. Empty directories get culled if they're not in use. it's giving spring cleaning but automated. πΈ
Cache culling happens on the basis of the percentage of blocks and the percentage of files available in the underlying filesystem. There are six "limits":
brunfrunβ if the amount of free space and the number of available files in the cache rises above both these limits, then culling is turned off.bcullfcullβ if the amount of available space or the number of available files in the cache falls below either of these limits, then culling is started.bstopfstopβ if the amount of available space or the number of available files in the cache falls below either of these limits, then no further allocation of disk space or files is permitted until culling has raised things above these limits again.
These must be configured thusly:
0 <= bstop < bcull < brun < 100
0 <= fstop < fcull < frun < 100
Note that these are percentages of available space and available files, and do not appear as 100 minus the percentage displayed by the df program. Do not get got by this. π
The userspace daemon scans the cache to build up a table of cullable objects. These are then culled in least recently used order. A new scan of the cache is started as soon as space is made in the table. Objects will be skipped if their atimes have changed, or if the kernel module says it's still using them. respectful of boundaries, as she should be. π
Culling can be disabled with the nocull option.
π SEE ALSO π
cachefilesd(8)df(1)/usr/share/doc/cachefilesd/README
π AUTHORS π
David Howells <dhowells@redhat.com> β thank you for your service, king. π«Ά
and that's the whole page, bestie!! this one came out of the Linux world on 14 November 2005, so shoutout to the elders for keeping the receipts. you understood it, you ate, no crumbs left. bye pookie πβ¨ππ¦πΈπ
π¦ where this page comes from
- alpine 3.24: cachefilesd-doc 0.10.10-r3 Β· GPL
- alpine 3.24: cachefilesd-inotify-doc 0.11.1-r0 Β· GPL-2.0-or-later
- centos-stream 10: cachefilesd 0.10.10-20.el10 Β· GPL-2.0-or-later
- centos-stream 9: cachefilesd 0.10.10-12.el9 Β· GPLv2+
- debian bookworm: cachefilesd 0.10.10-0.3 Β· GPL-2.0-or-later
- debian trixie: cachefilesd 0.10.10-0.4 Β· GPL-2.0-or-later
- fedora 43: cachefilesd 0.10.10-21.fc43 Β· GPL-2.0-or-later
- fedora 44: cachefilesd 0.10.10-23.fc44 Β· GPL-2.0-or-later
- nixos 26.05: cachefilesd 0.10.10
- nixpkgs unstable: cachefilesd 0.10.10
- opensuse-leap 16.0: cachefilesd 0.10.10-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: cachefilesd 0.10.10-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: cachefilesd 0.10.10-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: cachefilesd 0.10.10-bp160.2.1 Β· GPL-2.0-or-later
- ubuntu jammy: cachefilesd 0.10.10-0.2ubuntu1 Β· GPL-2.0-or-later
- ubuntu noble: cachefilesd 0.10.10-0.2ubuntu1 Β· GPL-2.0-or-later
- ubuntu questing: cachefilesd 0.10.10-0.4ubuntu1
- ubuntu resolute: cachefilesd 0.10.10-0.6ubuntu1 Β· GPL-2.0-or-later
- ubuntu stonking: cachefilesd 0.10.10-0.6ubuntu2 Β· GPL-2.0-or-later
- Copyright (C) 2006 Red Hat, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms