NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle1 view

Where are kernel parameters set at runtime (for example, memory for TCP packets), and how do you apply them?

Practice

Asked at

AI answer

Kernel parameters can be changed at runtime using sysctl (they are also available under /proc/sys). For example, for TCP buffers:

sudo sysctl -w net.core.rmem_max=16777216
sudo sysctl -w net.core.wmem_max=16777216

This change takes effect immediately, but usually does not persist after a reboot. To make the setting permanent, add the parameters, for example, to /etc/sysctl.d/99-network.conf, then apply them with sudo sysctl --system. For TCP, it is also useful to consider net.ipv4.tcp_rmem and net.ipv4.tcp_wmem: they specify the minimum, initial, and maximum TCP buffer sizes.