CACHEFILESD.CONF(5) Cache Files Utilities CACHEFILESD.CONF(5)
/etc/cachefilesd.conf - Local file caching configuration file
| Use Case | Command | Description |
|---|---|---|
| Set cache directory | dir <path> | Specify root of cache (mandatory) |
| Set security context | secctx <label> | Specify LSM context for kernel cache operations |
| Set block culling limits | brun <N>%, bcull <N>%, bstop <N>% | Percentage of free block space (run, cull, stop) |
| Set file count culling limits | frun <N>%, fcull <N>%, fstop <N>% | Percentage of free files (run, cull, stop) |
| Set cache tag | tag <name> | Distinguish multiple caches (default βCacheFilesβ) |
| Set cull table size | culltable <log2size> | Log2 of table entries (12β20, default 12) |
| Disable culling | nocull | Disable all culling activity |
| Set resume thresholds | resume_thresholds <blocks> <files> | Blocks/files to free before resume scanning |
| Set debug mask | debug <mask> | Numeric bitmask for kernel debugging (default 0) |
The configuration file for cachefilesd which can manage a persistent cache for a variety of network filesystems using a set of files on an already mounted filesystem as the data store.
This configuration file can contain a number of commands. Each one should be on a separate line. Blank lines and lines beginning with a β#β character are considered to be comments and are discarded.
Mandatory command:
π dir <path> β This command specifies the directory containing the root of the cache. It may only be specified once per configuration file.
Optional commands:
π secctx <label> β Specify an LSM security context as which the kernel will perform operations to access the cache. The default is to use cachefilesdβs security context. Files will be created in the cache with the label of directory specified to the dir command.
π brun <N>%
π bcull <N>%
π bstop <N>%
π frun <N>%
π fcull <N>%
π fstop <N>% β These commands configure the culling limits. The defaults are 7% (run), 5% (cull) and 1% (stop) respectively. See the section on cache culling for more information. The commands beginning with a βbβ are file space (block) limits, those beginning with an βfβ are file count limits.
π·οΈ tag <name> β This command specifies a tag to FS-Cache to use in distinguishing multiple caches. This is only required if more than one cache is going to be used. The default is βCacheFilesβ.
π culltable <log2size> β This command specifies the size of the tables holding the lists of cullable objects in the cache. The bigger the number, the faster and more smoothly that culling can proceed when there are many objects in the cache, but the more memory will be consumed by cachefilesd. The quantity is specified as log2 of the size actually required, for example 12 indicates a table of 4096 entries and 13 indicates 8192 entries. The permissible values are between 12 and 20, the latter indicating 1048576 entries. The default is 12.
π« nocull β Disable culling. Culling and building up the cull table take up a certain amount of a systemβs resources, which may be undesirable. Supplying this option disables all culling activity. The cache will keep building up to the limits set and wonβt be shrunk, except by the removal of out-dated cache files.
β―οΈ resume_thresholds <blocks> <files> β This command specifies the amount of blocks or files that the kernel should let go of before the daemon should resume from culling table scan suspension. Scanning to refill the cull table is suspended when all the objects in a cache are pinned by a live network filesystem in the kernel and thereβs nothing to cull. Either value can be β-β to indicate that this threshold should be ignored.
π debug <mask> β This command specifies a numeric bitmask to control debugging in the kernel module. The default is zero (all off). The following values can be ORβd into the mask to collect various information:
This mask can also be set through /sys/module/cachefiles/parameters/debug.
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
This places the cache storage objects in a directory called β/var/cache/fscacheβ, names the cache βmycacheβ, permits the cache to run freely as long as thereβs at least 10% free space on /var/cache/fscache/, 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 is suspended, it wonβt reactivate until the amount of free space rises again to 10% or better.
Furthermore, this will tell 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.
The cache may need culling occasionally to make space. This 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 are culled if not in use.
Cache culling is done on the basis of the percentage of blocks and the percentage of files available in the underlying filesystem. There are six βlimitsβ:
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.
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 is still using them.
Culling can be disabled with the nocull option.
cachefilesd(8), df(1), /usr/share/doc/cachefilesd/README
David Howells <dhowells AT redhat.com>
Linux 14 November 2005 CACHEFILESD.CONF(5)
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-14 20:58 @2600:1f28:365:80b0:4d23:66fa:c2bb:7bae
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)