is ther a way to set custom sysctl settings in
mac sequoia 15.0 (on my 2018 i7 mac mini) like this
sudo sysctl vm.swappiness=133
sudo sysctl vm.page-cluster=4
sudo sysctl vm.dirty_background_ratio=5
sudo sysctl vm.watermark_scale_factor=15
sudo sysctl vm.dirty_ratio=50
sudo sysctl vm.vfs_cache_pressure=400
sudo sysctl vm.dirty_expire_centisecs=1000
sudo sysctl vm.dirty_writeback_centisecs=0
sudo sysctl vm.dirtytime_expire_seconds=1800
(my custom linux config) but for mac
as i dont need a lot of caching that often , is ther
a mac version of these command strings
if so how does the go , whats the file to edit
From man sysctl.conf on my MacBook:
SYSCTL.CONF(5) File Formats Manual SYSCTL.CONF(5)
NAME
sysctl.conf – kernel state defaults
DESCRIPTION
The /etc/sysctl.conf file is read in when the system goes into multi-user mode to set
default settings for the kernel. The /etc/sysctl.conf is in the format of the sysctl(8)
command, i.e.
sysctl_mib=value
Comments are denoted by a “#” at the beginning of a line.
FILES
/etc/sysctl.conf Initial settings for sysctl(8).
EXAMPLES
To disable coredumps, you may use a configuration like:
# Disable coredumps.
kern.coredump=0
SEE ALSO
sysctl(8)
HISTORY
The sysctl.conf file appeared in FreeBSD 4.0.
BUGS
If loadable kernel modules are used to introduce additional kernel functionality and
sysctls to manage that functionality, sysctl.conf may be processed too early in the boot
process to set those sysctls.
macOS 15.7 August 3, 2007 macOS 15.7```
Most of those Linux VM knobs do not have a 1:1 macOS equivalent. macOS has sysctl, but the VM subsystem is different, so settings like swappiness, dirty_ratio, vfs_cache_pressure, etc. are Linux-specific and should not be translated blindly. I would first run sysctl -a | grep ^vm. and only change a key if Apple documents it or you have a very specific test. For persistence, /etc/sysctl.conf may work for some early kernel keys, but many runtime/userland tunables are better handled with a launchd job that runs sysctl after boot. I would avoid disabling SIP just to chase Linux-style cache behavior; it is usually not worth the security tradeoff.