Kernel Tuning with sysctl


Kernel Tuning with sysctl

As the 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 you had to recompile the kernel.

The sysctl utility can change some parameters of a running kernel. It does this through the /proc file system, a "virtual window" into the running kernel. Although it might appear that a group of directories and files exist under /proc, that's only a representation of parts of the kernel, referred to as variables. We can display a list of the variables as shown in the following:

 sysctl -A kernel.HZ = 1000 kernel.min-timeslice = 1000 kernel.def-timeslice = 21000 kernel.ngroups_max = 65536 kernel.printk_ratelimit_burst = 10 kernel.printk_ratelimit = 5 kernel.panic_on_oops = 0 kernel.pid_max = 32768 kernel.overflowgid = 65534 kernel.overflowuid = 65534 kernel.pty.nr = 5 kernel.pty.max = 4096 kernel.random.uuid = 7e576126-6356-4159-afd3-4de6a0227736 kernel.random.boot_id = 152ee742-ef9d-49c5-a271-cb98662ddc7e kernel.random.write_wakeup_threshold = 128 kernel.random.read_wakeup_threshold = 64 

This is just a partial listing of some kernel settings the whole list runs about 20 pages.

Note

To see the full list of variables, enter sysctl -A at the shell prompt. You can learn more about working with the kernel by reviewing the kernel API documentation at http://kernelnewbies.org/documents/kdoc/kernel-api/linuxkernelapi.html.


If you want to change a value, use the -w (write) switch:

sysctl -w kernel.pid_max=35000 

We've increased the maximum PID (process ID) number with this command.

This change is good only for the current session. If you find a setting is useful, save it to the /etc/sysctl.conf file. The syntax is identical to the shell command:

kernel.pid_max=35000 

This tool is more interesting to kernel hackers than to most users, but it is a potentially powerful tool.



SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net