rdmsm4x-changelog-20260926-2120-restore-sysctl-defaults-and-remove-boot-optimizations
rdmsm4x-changelog-20260926-2120-restore-sysctl-defaults-and-remove-boot-optimizations
Restored macOS kernel sysctl parameters to stock defaults and removed custom boot optimization LaunchDaemons.
Scope
- Host:
rdmsm4x(macOS 27.2.0, Apple Silicon Mac16,9 M4 Max) - Note: Inventory check confirmed
com.user.sysctltuning.plistis also present onrdmbair13m5,rdmbair15m5, andrdmpw3275m. Those hosts currently have active workloads and were not modified during this run; backups were prepared.
Exact Files Touched
- Backed up and removed:
/Library/LaunchDaemons/com.user.sysctltuning.plist/Library/LaunchDaemons/limit.maxfiles.plist
- Backup destination:
/Users/richh/dev/fleet/backups/20260926-sysctl-restore/com.user.sysctltuning.plist(SHA256:90570d47accd0118497b2eb1f555353e23e7551620d9b230ed20a4343f921ae8)/Users/richh/dev/fleet/backups/20260926-sysctl-restore/limit.maxfiles.plist(SHA256:310d9b7baa5d40491a2a3650a6101fce46d9fdd4f0f6b99d916f40df9a88c0a7)
Commands Run
# 1. Reset network sysctl parameters to macOS stock defaults
sudo sysctl -w \
net.inet.tcp.sendspace=131072 \
net.inet.tcp.recvspace=131072 \
net.inet.tcp.autorcvbufmax=4194304 \
net.inet.tcp.autosndbufmax=4194304 \
kern.ipc.maxsockbuf=8388608
# 2. Reset filesystem and proc limit sysctl parameters to stock defaults
sudo sysctl -w \
kern.maxfilesperproc=122880 \
kern.maxfiles=245760 \
kern.maxvnodes=263168
# 3. Unload persistent boot LaunchDaemons
sudo launchctl unload /Library/LaunchDaemons/com.user.sysctltuning.plist
sudo launchctl unload /Library/LaunchDaemons/limit.maxfiles.plist
# 4. Backup plists to fleet storage
mkdir -p ~/dev/fleet/backups/20260926-sysctl-restore
sudo cp -p /Library/LaunchDaemons/com.user.sysctltuning.plist ~/dev/fleet/backups/20260926-sysctl-restore/
sudo cp -p /Library/LaunchDaemons/limit.maxfiles.plist ~/dev/fleet/backups/20260926-sysctl-restore/
# 5. Remove custom boot plists
sudo rm /Library/LaunchDaemons/com.user.sysctltuning.plist /Library/LaunchDaemons/limit.maxfiles.plistVerification Evidence
Sysctl Values Before vs After
| Parameter | Custom Tuned | Restored Default | Stock Peer Baseline
(jdmbair13m5) |
|---|---|---|---|
kern.maxvnodes |
4000000 |
263168 |
263168 |
kern.maxfiles |
5000000 |
245760 |
245760 |
kern.maxfilesperproc |
2500000 |
122880 |
122880 |
net.inet.tcp.sendspace |
1048576 |
131072 |
131072 |
net.inet.tcp.recvspace |
1048576 |
131072 |
131072 |
net.inet.tcp.autorcvbufmax |
8388608 |
4194304 |
4194304 |
net.inet.tcp.autosndbufmax |
8388608 |
4194304 |
4194304 |
kern.ipc.maxsockbuf |
16777216 |
8388608 |
8388608 |
Daemon & Limit Verification
sudo launchctl list | grep -E "sysctl|limit": returned 0 matches (no persistent tuning daemons loaded).sudo lsof -nP | wc -l: 56,446 open file descriptors (operating well within the 245,760 limit)./etc/sysctl.conf: verified absent.nvram boot-args: verified empty.
How to Undo
To re-enable custom optimizations at boot:
sudo cp ~/dev/fleet/backups/20260926-sysctl-restore/com.user.sysctltuning.plist /Library/LaunchDaemons/
sudo cp ~/dev/fleet/backups/20260926-sysctl-restore/limit.maxfiles.plist /Library/LaunchDaemons/
sudo chown root:wheel /Library/LaunchDaemons/com.user.sysctltuning.plist /Library/LaunchDaemons/limit.maxfiles.plist
sudo chmod 644 /Library/LaunchDaemons/com.user.sysctltuning.plist /Library/LaunchDaemons/limit.maxfiles.plist
sudo launchctl load /Library/LaunchDaemons/com.user.sysctltuning.plist
sudo launchctl load /Library/LaunchDaemons/limit.maxfiles.plistOutstanding Owner Actions
- None required for immediate operation.
- On next system restart, Darwin will boot cleanly using 100% native kernel limits without any startup overrides.