Put in remaining pages and wiki contents.
[ikiwiki.git] / docs / handbook / handbook-configtuning-sysctl.mdwn
1 \r
2 \r
3 ## 6.11 Tuning with sysctl \r
4 \r
5 [sysctl(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#sysctl&section8) is an interface that allows you to make changes to a running DragonFly 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)](http://leaf.dragonflybsd.org/cgi/web-man?command=sysctl&section=8).\r
6 \r
7 At its core, [sysctl(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#sysctl&section8) serves two functions: to read and to modify system settings.\r
8 \r
9 To view all readable variables:\r
10 \r
11     \r
12     % sysctl -a\r
13 \r
14 \r
15 To read a particular variable, for example, `kern.maxproc`:\r
16 \r
17     \r
18     % sysctl kern.maxproc\r
19     kern.maxproc: 1044\r
20 \r
21 \r
22 To set a particular variable, use the intuitive `***variable***`=`***value***` syntax:\r
23 \r
24     \r
25     # sysctl kern.maxfiles=5000\r
26     kern.maxfiles: 2088 -< 5000\r
27 \r
28 \r
29 Settings of sysctl variables are usually either strings, numbers, or booleans (a boolean being `1` for yes or a `0` for no).\r
30 \r
31 If you want to set automatically some variables each time the machine boots, add them to the `/etc/sysctl.conf` file. For more information see the [sysctl.conf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command#sysctl.conf&section5) manual page and the [configtuning-configfiles.html#CONFIGTUNING-SYSCTLCONF Section 6.10.4].\r
32 \r
33 ### 6.11.1 sysctl(8) Read-only \r
34 \r
35 ***Contributed by Tom Rhodes. ***\r
36 \r
37 In some cases it may be desirable to modify read-only [sysctl(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#sysctl&section8) values. While this is not recommended, it is also sometimes unavoidable.\r
38 \r
39 For instance on some laptop models the [cardbus(4)](http://leaf.dragonflybsd.org/cgi/web-man?command#cardbus&section4) device will not probe memory ranges, and fail with errors which look similar to:\r
40 \r
41     \r
42     cbb0: Could not map register memory\r
43     device_probe_and_attach: cbb0 attach returned 12\r
44 \r
45 \r
46 Cases like the one above usually require the modification of some default [sysctl(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#sysctl&section8) settings which are set read only. To overcome these situations a user can put [sysctl(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=sysctl&section=8) ***OIDs*** in their local `/boot/loader.conf`. Default settings are located in the `/boot/defaults/loader.conf` file.\r
47 \r
48 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)](http://leaf.dragonflybsd.org/cgi/web-man?commandcardbus&section=4) will work properly.\r
49 \r
50 \r
51 \r
52 CategoryHandbook\r
53 CategoryHandbook-configuration\r