sysctl(8) is used to make changes to a running FreeBSD system. This includes many advanced options of the TCP/IP stack and virtual memory system that can dramatically improve performance for an experienced system administrator. Over five hundred system variables can be read and set using sysctl(8).
At its core, sysctl(8) serves two functions: to read and to modify system settings.
To view all readable variables:
% sysctl -aTo read a particular variable, for example,
kern.maxproc:
% sysctl kern.maxproc
kern.maxproc: 1044To set a particular variable, use the intuitive
variable=value
syntax:
# sysctl kern.maxfiles=5000
kern.maxfiles: 2088 -> 5000Settings of sysctl variables are usually either strings,
numbers, or booleans (a boolean being 1 for
yes or a 0 for no).
To automatically set some variables each time the machine
boots, add them to /etc/sysctl.conf. For
more information refer to sysctl.conf(5) and Section 12.11.3, “sysctl.conf”.
In some cases it may be desirable to modify read-only sysctl(8) values. While this is sometimes unavoidable, it can only be done on (re)boot.
For instance on some laptop models the cardbus(4) device will not probe memory ranges, and fail with errors which look similar to:
Cases like the one above usually require the modification
of some default sysctl(8) settings which are set read
only. To overcome these situations a user can put
sysctl(8) “OIDs” in their local
/boot/loader.conf. Default settings are
located in
/boot/defaults/loader.conf.
Fixing the problem mentioned above would require a user to
set hw.pci.allow_unsupported_io_range=1 in
the aforementioned file. Now cardbus(4) will work
properly.
This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.