# Tuning Linux

Mark
Komarinski

               mkomarinski@wayga.org

Michael
C.
Jett
0.30
2001-4-17
mfk
Outline stuff from Michael C. Jett
0.20
2001-3-27
mfk
Created network and disk chapters. Need more info!
0.10
2001-2-28
mfk
Second pass. Time to add some data.
0.01
2001-01-25
mfk
First pass for the book. Define the outline.

This work covers tuning Linux and the hardware it runs on for the best efficiency. This can make existing hardware run faster, or give network architechts information to make informed decisions about servers and their requirements.

## Foreward

The idea of a book on tuning Linux for performance is pretty much a moving target. Linux makes advances at a rapid pace, and things change often. Since its introduction in 1991, Linux has gone from a state where it could not compile itself (and barely boot) into a system that can take up to three full CD-ROMs to install much of the software. It rivals operating systems twice its age in terms of performance and stability. Its complete heritage may never be known because of the thousands of people around the world who have contributed patches, drivers, and enhancements to make Linux better.

This advancement means that some portions of Linux can literally turn on a dime. The Linux 2.0 kernel used a program called ipfwadm to administer its firewall settings. When 2.2 came out, the program was ipchains, and used completely different concepts than ipfwadm. The 2.4 kernel uses iptables, which itself is different from its predecessors. This means that Linux has little baggage holding it back when it comes to backwards compatability. Some open source applications need no changes, most may need to be recompiled, and some require programming changes that can be done by any programmer. The idea of backwards compatability in Linux is a foreign concept.

But tuning Linux is more than just tuning what you have. It is looking at your requirements, evaluating the technology that can solve that requirement, and going with the balance between cost and performance. Not everyone can afford the best cards, but the difference between good and poor performance can be a very small cost as compared to the overall system cost.

## Copyright

This document is Copyright (c) 2001-2016 Mark F. Komarinski mkomarinski@wayga.org.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at https://www.gnu.org/licenses/fdl.html.

## Introduction

This book is arranged into a few major sections. This will allow you to read the sections of the book that apply to the kind of tuning you want to do.

- Fundamentals

  > What is the nature of performance tuning? How should you go about looking at an entire system in terms of improving the services it provides to others? What common strategies are available? We will go through the basics of performance tuning in detail for this chapter.

- Measuring performance

  > This chapter will deal with measuring performance from a system on various levels, outling common tools bundled with your Linux system or available on the Internet. Once you know how fast your system is in its current state, you have a baseline to measure against.

- Disk

  > This section will compare various kinds of permanent storage. We'll take a look at hard drives, how to write to them, and any tradeoffs between reliability and raw speed.

- Kernel

  > This section will cover some of the popular kernels that are available and how you can use the built in tools to tune it for maximum performance. We'll cover things like the /proc directory,
  > sysctl, and recompiling kernels.

- Network

  > There are a variety of networking schemes, and one will fit your need. Even once you have chosen your networking method, there are ways of enhancing it for even better performance.

- Applications

  > This section is not strictly about Linux, but poorly configured applications can quickly erode any advantages from other tuning methods. We will take a look at tuning various web servers, database applications, and cluster software.

&conventions;

&fundamentals; &measurement; &disk; &network; &kernel; &apps;