Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 2003 > November

Linux Kernel Tuning Using System Control

Dustin Puryear

Some of the most notable performance improvements for Linux can be accomplished via system control (sysctl) in /proc/sys. Unlike most other areas of /proc under Linux, sysctl variables are typically writable, and are used to adjust the running kernel rather than simply monitor currently running processes and system information. In this article, I'll walk you through several areas of sysctl that can result in large performance improvements. While certainly not a definitive work, this article should provide the foundation needed for further research and experimentation with Linux sysctl.

Note that I wrote this article with the 2.4 kernel in mind. Some variables may exist in earlier kernels but not in 2.4, or vice versa.

Working with the sysctl Interface

The sysctl interface allows administrators to modify variables that the kernel uses to determine behavior. There are two ways to work with sysctl: by directly reading and modifying files in /proc/sys and by using the sysctl program supplied with most, if not all, distributions. Most documentation on sysctl accesses variables via the /proc/sys file system, and does so using cat for viewing and echo for changing variables, as shown in the following example where IP forwarding is enabled:

# cat /proc/sys/net/ipv4/ip_forward
0
# echo "1" > /proc/sys/net/ipv4/ip_forward
# cat /proc/sys/net/ipv4/ip_forward
1
This is an easy way to work with sysctl. An alternative is to use the sysctl program, which provides an easy interface to accessing sysctl. With the sysctl program, you specify a path to the variable, with /proc/sys being the base. For example, to view /proc/sys/net/ipv4/ip_forward, use the following command:

# sysctl net.i

				  



MarketPlace

Free Download Speeds Up PCs
Make Your PC Faster --New Diskeeper 2008 Speeds Up PCs --Download Free Trial Now!

Automate Software Builds with Visual Build Pro
Easily create an automated, repeatable process for building and deploying software.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

WinDev 12 - Powerful IDE
Develop 10 times faster ! ALM, IDE, .Net, RAD, 5GL, Database, 5GL, 64-bit, etc. Free Express version

Wanna see your ad here?