Where are kernel parameters set at runtime (for example, memory for TCP packets), and how do you apply them?
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.
Also asked at RWB
- Why did you decide to change jobs / leave your current company?
- What is the key difference between TCP and UDP?
- What is the difference between git merge and git rebase? When should each approach be used?
- What is an inode in Linux?
- Which command is used to determine the route of a packet from your device to the target host?
Similar questions
- Where can you set Linux kernel parameters (for example, to disable an NVIDIA graphics card)?
- How can you view the parameters with which the Linux kernel was started?
- Which TCP parameters (sysctl) do you change for low-latency, high-load HTTP services?
- What kernel parameters and options can be added in the Linux bootloader’s interactive mode?
- How can you view which kernel modules are currently loaded on the system?