sysctl — kernel parameters at runtime
cheat sheet · Ubuntu 24.04 · procps 4.0 https://lab.dimsanych.ru/en/wiki/sysctl/Cheat sheet
-
sysctl vm.swappinessread a parameter -
sysctl -n vm.swappinessthe value only -
sudo sysctl -w vm.swappiness=10until reboot -
echo 'vm.swappiness = 10' \ -
| sudo tee /etc/sysctl.d/90-swappiness.confpermanently -
sudo sysctl --systemapply all files -
sudo sysctl -p /etc/sysctl.d/90-swappiness.confone file -
sysctl -a 2>/dev/null | grep forwardfind a parameter
Options
Common parameters:
| Parameter | What for |
|---|---|
vm.swappiness |
eagerness to swap (60 by default) |
net.ipv4.ip_forward |
packet forwarding: router, NAT, containers |
fs.nr_open |
ceiling of the per-process open files limit |
fs.file-max |
open files for the whole system |
fs.inotify.max_user_watches |
inotify watches (editors, tail -f) |
kernel.pid_max |
the largest PID (4194304 on Ubuntu) |
kernel.dmesg_restrict |
1 — dmesg for root only |
kernel.hung_task_timeout_secs |
after how many seconds in D the kernel reports a hung task |
net.core.somaxconn |
connection queue of a listening socket |
The command's own options are in the table below.