Книга: Fedora™ Unleashed, 2008 edition
Kernel
Kernel
As the Linux kernel developed over time, developers sought a way to fine-tune some of the kernel parameters. Before sysctl
, those parameters had to be changed in the kernel configuration and then the kernel had to be recompiled.
The sysctl
command can change some parameters of a running kernel. It 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. 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. (An annotated list is presented because roughly 250 items — or more — exist in the full list.)
# 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 actually tweaking these values is beyond the scope of this book. If you want to change a value, however, the -w command is used:
# sysctl -w net.ipv4.tcp_retries 2=20
This increases the value of that particular kernel parameter.
NOTE
Fedora provides a graphical interface to the sysctl
command in system-config-proc
. It's still a beta-quality application, and it must be launched from the command line. The interface itself is unremarkable, and it does not provide a means to manipulate all the possible values, but it does offer useful help for the kernel variables it addresses.
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:
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.
Both GNOME and KDE are "heavyweight" desktop systems: They are all-inclusive, all-singing, and all-dancing environments that do far more than browse your file system. The drawback to this is that their size makes them run slowly on older systems. On the flip side, Fedora also comes with the Xfce desktop, which is a great deal slimmer and faster than the other two. If you find GNOME and KDE are struggling just to open a file browser, Xfce is for you.
Alternatively, if you simply cannot live without GNOME or KDE, take a look in the /usr/share/autostart
directory, where you will see a list of files that are started when your graphical system boots. If you do not need any of them, just move them out of there and into somewhere safe in case you ever need them again.
- Kernel setup
- Kernel Address Space
- Loading the Linux Kernel
- Using the BIOS and Kernel to Tune the Disk Drives
- CHAPTER 36 Kernel and Module Management
- The Linux Kernel
- Types of Kernels
- Kernel Versions
- Obtaining the Kernel Sources
- Patching the Kernel
- Compiling the Kernel
- Using xconfig to Configure the Kernel