Hi,
I'm encountering an issue with excessive cache usage on my OpenBSD 7.5
hosting server.
The setup includes an AMD Ryzen 9 7900X3D with 128GB RAM and NVMe storage.
After a fresh boot, I typically see around 110GB of free memory, but
once I initiate a backup with rsync (many files), the cache usage
quickly grows to over 100GB.
This significant increase in cache appears to slow down I/O operations,
especially affecting PHP applications that include a large number of
files. Load times for these applications increase from about 0.5 seconds
to almost 2 seconds.
It seems that the large filesystem I/O cache is impacting overall system
performance. Here are my current kernel settings:
kern.numvnodes = 689808 => kern.maxvnodes = 984903 (70%)
kern.nfiles = 7356 => kern.maxfiles = 65536 (11%)
kern.nprocs = 1295 => kern.maxproc = 4096 (31%)
kern.nthreads = 1777 => kern.maxthread = 8192 (21%)
kern.seminfo.semusz = 112 => kern.seminfo.semmns = 4096 (2%)
kern.bufcachepercent = 20
I've tried adjusting kern.bufcachepercent and kern.maxvnodes to limit
cache growth, but the cache still occupies a large portion of memory.
Is there a way to limit memory cache usage on OpenBSD?
Thanks in advance!