Slashdot Mirror


Performance Tuning for Linux Servers

swsuehr writes "Performance Tuning for Linux Servers provides information and resources for Linux administrators looking for a guide to the background, options, and commands available for enhancing the performance of a Linux server." Clear enough -- but read on for Suering's review of the book to see if it might help you at that task. Performance Tuning for Linux Servers author Johnson, Huizenga, Pulavarty, et al pages 547 publisher IBM Press/Pearson rating 8 reviewer Steve Suehring ISBN 013144753X summary Information and techniques for performance enhancement of Linux servers.

The Particulars

The book is 547 pages. Of that total, 507 are the content of the book while 13 pages are used for an Appendix. The Appendix is provides a look at some of the tunable parameters in the Linux kernel through interfaces such as sysctl and /proc. This appendix alone makes the book good reference material. The book is divided into five sections including an overview of Linux, performance analysis tools, system tuning, performance characterization, and case studies. The book covers the 2.6 kernel series and the 2.4 series where appropriate.

The book is published under the IBM Press brand but is most definitely not an IBM-centric book. The book is largely, though not completely, distribution neutral. Distribution neutrality means that you don't have to be running any certain flavor of Linux in order to follow the examples in the book. The book covers Red Hat Enterprise and Novell SuSE Linux Enterprise but does so in a non-intrusive manner such that most of the references are simply used to illustrate a certain point rather than requiring the reader to follow a step-by-step process. For instance, BSD and System V initialization processes are both covered in Chapter 1.

The book wasn't written by a single author. In fact, it appears to be the work of numerous authors, each contributing certain sections or chapters. With this type of format it's very easy for a book to lack cohesiveness. This isn't the case with Performance Tuning for Linux Servers where the material shares the same tone throughout. Truthfully, I didn't know that there were so many contributors until I was writing the review, that's how well the material flows together.

A Look Inside

Performance Tuning for Linux Servers combines both theory and practice. The essential background information is given for each subject but interwoven with practical knowledge. For example, Chapter 8 describes tuning of the scheduler including a list of tunable parameters with both a description and an effect. From p. 193:

"MAX_SLEEP_AVG"

"Description: The value of this parameter is the maximum sleep average a task can accumulate for the purposes of calculating the scheduling bonus. A task with this sleep average gets the maximum bonus as indicated by PRIO_BONUS_RATIO." "Effect: If the value of this parameter is increased, tasks need to accumulate a larger sleep average to get the same priority bonus. Decreasing the value has the opposite effect."

Several performance analysis tools are covered in some detail. These can be invaluable when trying to track down performance problems with a Linux server. One of the advantages to Linux is that it doesn't need to be rebooted in order to "clean up" as other operating systems need from time to time. Using these performance analysis tools, the administrator can track down exactly what is causing a bottleneck or resource issue on the server.

The performance analysis tools are mainly discussed in chapter 4, "System Performance Monitoring." The chapter is broken down into sections based on the type of resource to be analyzed. The sections include CPU Utilization where general tips such as `cat /proc/cpuinfo` are given in addition to detailed discussion of vmstat, top, gtop, and sar (part of the sysstat package). The next section discusses Memory Utilization which looks at some of the information available through /proc before detailing ps and vmstat. I/O Utilization is the next section where iostat is discussed along with another look at sar. Finally, Network Utilization rounds out this chapter with brief discussion of commands such as arp, ifconfig, and other basic network commands before detailing netstat. Throughout this chapter examples of output are given for many commands.

The authors do a great job at not only condensing the material but, more importantly, they also bring some highly technical concepts down to the reader's level. Take for example chapter 2, "Kernel Overview" where a detailed discussion of the architecture of the Linux kernel is given.

Part III of the book is devoted to system tuning (it's aptly titled "System Tuning"). This section of the book provides detailed background information so that the administrator can make educated decisions about what to tune. For example, chapter 9 is devoted to the Linux virtual memory subsystem and includes a discussion of not only how virtual memory is handled in the kernel (including new features for the 2.6 series) but also the tunable parameters for virtual memory.

Within Part III are chapters on the aforementioned virtual memory subsystem, the scheduler, I/O subsystems, file systems, network, IPC, and code tuning. Chapter 11, "File System Tuning", opens with a discussion of the basic terms in file systems before continuing on with discussion of specific file systems including ext2, ext3, ReiserFS, JFS, and XFS.

Part IV of the book looks at characteristics of Linux server applications. Doing so helps to frame the discussion of the different attributes important to tuning the server for each of these applications. The last section of the book, beginning of page 405, is devoted to case studies.

One final highlight for the book is that most chapters include a detailed references section with pointers to relevant information for that chapter. Some chapters have more references than others. The references might be anything from a man page to a magazine article to a book and a few other resources.

The combination of both detailed background information along with practical techniques, all of which are explained clearly, makes Performance Tuning for Linux Servers a great resource for Linux administrators who want to squeeze optimal performance from their server. I believe the book has a good shelf life that will keep it on my bookshelf for quite a long time.

You can purchase Performance Tuning for Linux Servers from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

8 of 121 comments (clear)

  1. Re:What does it tune?!? by CptChipJew · · Score: 2, Insightful

    It seems like this book is meant for more general purpose tuning, which is in itself quite useful and important. I've seen books before for tuning specific server types. Perhaps having these both would make a good combo reference.

    --
    Vonal Declosion
  2. Re:What does it tune?!? by gbjbaanb · · Score: 2, Insightful

    Surely it gives you enough information to understand how to tune each of the types of server. That's surely what you want, not a 'how-to tune a database server running mysql on the 2.6 kernel with the ReiserFS filesystem'

    Again, it'll also be distro independant, Red Hat is just the same as Suse as Debian when you're discussing the merits of one filesystem over another.

  3. Re:I went to a talk from the author by owlstead · · Score: 2, Insightful

    1) Tune your old server.
    2) Save cost on new server. Don't buy Dell (for servers or laptops).
    3) Be happy.
    4) ???
    5) This is getting old.

  4. Hardware is cheap. Tuning is tricky. by Anonymous Coward · · Score: 0, Insightful

    Considering the bang for the buck of modern hardware, and how easy it is to screw things up without deep understanding, doesn't it mostly make sense to buy hardware that gives the performance you need rather than tweaking random knobs to beat out another 5% performance increase?

  5. Re:What does it tune?!? by RollingThunder · · Score: 2, Insightful

    You're not the intended market for this book.

    This book teaches people how to tune the things that they see are bottlenecking via monitoring software.

    From your posts, you just want a list of items to set for a given "type" of server, completely overlooking the fact that tuning is much more related to the workload of a given box than just what broad type of workload it fits in to.

  6. Re:Wrong by Feyr · · Score: 4, Insightful

    take note, i haven not read the benchmark.

    for older linux kernels, and some hardware, freebsd has better throughput (and more importantly, won't crash under high load). but it fails behind in LATENCY under lower load. it always will because of the design choice they made. easier to implement, bit more latency under low load

    with recent linux kernels, NAPI (New Api, more appropriately named "Rx Polling") was introduced, and some of the drivers were converted to use that, bringing linux up to scratch FOR THAT HARDWARE. due to the above mentioned design choice, in linux each drivers must be converted individually. the upside is that they don't suffer a latency hit under low load.

    unfortunately for me, the driver i need still lacks NAPI support. :(

    while we're on the subject of "freebsd has better performance", that's not actually true. while doing real-world tests for a rather large website in a mixed environment (freebsd, debian, redhat) i found that the reason freebsd SEEMED to perform better is that it was more aggresive in killing processes when it is under memory pressure, relieving stress on the swap area and as such, freeing up the cpu from doing the swapping work (that was before 2.6, which has some tuneables to help now)

  7. Re:I went to a talk from the author by Feyr · · Score: 2, Insightful

    don't knock em till you try em.

    we have a bunch of dell rackmount servers here (poweredge 2650 and 750) and i've never had ANY problem with them. compare that to our hp server (now relegated to being a backup of a backup because of unreliability) or sun (running, can't update anything on it lest it crash) or ibm (8U, slow as a duck, but built like a tank), i'll take a dell anyday. i just wish they had a line with opterons in them

  8. Re:I went to a talk from the author by virtual_mps · · Score: 2, Insightful
    Right back at you. We tried out a Dell server at work (2650 iirc). It crashed 3 times during the install (kickstart), and then within an hour of putting any load on it. Needless to say, the server only stayed in the rack for about 2 days before we shipped it back.

    Of course you should have shipped it back--you obviously got one that was damaged in shipping. Do you really believe that it's normal for dell servers to crash during an installation routine? I'm sure you can make some snippy response and get moderated +5 funny, but the reality is that dell obviously wouldn't be making money if it was normal for their servers to arrive doa. I've got racks full of 2650's, and I've only had to swap out some fans now and then. I've got some IBMs also, and they haven't been any more or less reliable than the dells. (Although, oddly, when IBM shipped us the dual opterons we had to install the second cpu's ourselves. You'd think IBM's price premium over dell would at least cover assembly.)