Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

does this through the /proc file system, which is a “virtual window” into the
running kernel. Although it might appear that a group of directories and files
exist under /proc, that is only a representation of parts of the kernel. When
you’re the root user (or using the sudo command), you can read values from
and write values to those “files,” referred to as variables. You can display a
list of the variables as shown in the following example: (which presents an
abbreviated list because roughly 250 items or more exist in the full list):


Click here to view code image
matthew@seymour:~$ sysctl -A
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_rfc1337 = 0
net.ipv4.tcp_stdurg = 0
net.ipv4.tcp_abort_on_overflow = 0
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_retries2 = 15
net.ipv4.tcp_retries1 = 3
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 7200
net.ipv4.ipfrag_time = 30


The items shown are networking parameters, and tweaking these values is
beyond the scope of this book. If you want to change a value, however, you
use the -w parameter:


Click here to view code image
matthew@seymour:~$ sysctl -w net.ipv4.tcp_retries 2=20


This increases the value of that particular kernel parameter.


If you find that a particular setting is useful, you can enter it into the
/etc/sysctl.conf file. The format is as follows, using the earlier
example:


Click here to view code image
net.ipv4.tcp_retries 2=20


Of more interest to kernel hackers than regular users, sysctl is a potentially
powerful tool that continues to be developed and documented.


TIP
The kernel does a good job of balancing performance for graphical
systems, so there’s not a great deal you can do to tweak your desktop to run
faster.
Free download pdf