Skip to content →

What is sysctl in Linux?

I’ve heard of systemctl, but not sysctl. I came across this in an awesome blog from from GCP regarding fixing a DNS issue on a VM.

It said,

The UDP stack can be configured at kernel level using the sysctl interface.

and,

To configure the kernel runtime, you can use command line options (grub) or the sysctl interface. I look in /etc/sysctl.conf, and lo and behold, there are several custom configurations.

So it seems like sysctl is an interface for configuring the kernel.

Lets check the man page.

sysctl - configure kernel parameters at runtime

sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/

man sysctl

In the article, the engineer used the following command to change the kernel’s configurations at runtime:

sysctl -w net.core.rmem_default=$((2**31-1))

So it looks like you can use -w to change a setting.

Much more to look at here, but at least I know what it is.

Published in Today I Learned