Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

Performance Tuning for Linux Servers

Posted by timothy on Tue Aug 09, 2005 03:24 PM
from the turn-that-thing-down! dept.
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.


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.
+ -
story
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.

  • a) Install FreeBSD.
    b) Reboot.
    • by Otter (3800) on Tuesday August 09 2005, @03:40PM (#13281697) Journal
      Hah! Just set the appropriate USE flags and make.conf (I prefer -O8 -- just remember it's a capital o, not a zero!) and no need for tuning!
    • c) switch off SETI@HOME
        • Re:Wrong (Score:3, Informative)

          It's worth it, for the better network performance [bulk.fefe.de]
          • In the slashdot article that preceeded that benchmark many moons ago...

            Wasn't it argued that the test itself was quite foobared due to the memory restrictions. In many cases, wasn't it really just benchmarking the swap file? I really don't know how well chipset support was arranged at the time. Don't get me wrong, I'm a huge fan of Linux... but that was not exactly a benchmark you want to toss around like it's gold.

            That's if I recall correctly...
            • Re:Wrong (Score:5, Insightful)

              by Feyr (449684) on Tuesday August 09 2005, @05:44PM (#13282469) Journal
              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)
  • by jjeffrey (558890) * <slash.jgj@org@uk> on Tuesday August 09 2005, @03:32PM (#13281640) Homepage
    In my experience, the number one tip for linux performance tuning is "man elvtune". I've seen it work miracles.
  • by HishamMuhammad (553916) on Tuesday August 09 2005, @03:32PM (#13281645) Homepage Journal
    IIRC, she [Sandra Johnson] is the head of one of IBM's Linux Technology Centers. It was pretty interesting and I got to skim the book for a while. Looked good, but I always have the fear that books like this get outdated fast. It had half a page on top -- I told her to include htop [sf.net] in the next edition. No plug is as shameless as when you do it in person. ;)

    • I just installed htop on my debian based web server, it's pretty nifty. Not that I need top that often, the computer runs at practically no load.
    • I looked at the xSeries prices on IBM.com, and here is my recommendation for 'Linux Tuning'. ;)

      1) Don't buy the book and save your $55.
      2) Configure the server you want on ibm.com. Go to dell.com and configure a similar server, note the amount saved on dell.com
      3) buy a dell server and use your extra money from 1) and 2) to get the cpu upgrade and the free double ram.
      4) Presto! Instant Linux Tuning! It even works with Windows at no extra charge!
      • 5) Buy a support contract from dell that guarentees your call doesn't get routed to india. 6) buy an extended service coverage plan for all your servers because you KNOW they're going to break, I mean lets get real, it is a Dell. 7) give the whole thing a miss and buy something other than a Dell.
        • 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
          • don't knock em till you try em.

            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.

            The IBM xSeries, OTOH, perform flawlessly for us.

            So from my POV, the Dells are cheaper, but they're also less expensive. :)

            IMO, get the vendors to give you a test box and play with them. Go from there.

            • 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 moder

      • 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.
    • You could start by changing your web page:

      This is htop, an interactive process viewer for Linux.

      Huh, nothing deeper than that.

      What are you trying to solve with this tool and why should I use it. Give me a better sales blurb.
  • What does it tune?!? (Score:5, Interesting)

    by stretch0611 (603238) <`stretch611' `at' `lycos.com'> on Tuesday August 09 2005, @03:34PM (#13281664) Journal
    While the reviewer mentions file systems he does not mention which servers the book tunes?

    Does the book go into details with database servers, file servers, web servers, and/or specific application servers.

    What type of linux servers does it teach you to tune?

    • 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.
      • What type of linux servers does it teach you to tune?
        From TFA:
        "The book is largely, though not completely, distribution neutral."
        That is, it should be generic enough to apply to nearly all Linux distros.

        That's nice but it does't answer the question. If I wanted a book on Linux Operating System Tuning I would ask which distribution. However, I want to know what "type of server" it tunes... (db, www, file, etc...)

        • 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.
        • 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.
        • I want to know what "type of server" it tunes... (db, www, file, etc...)

          It says right there in the title: "Linux". I understand that this sounds flippant, but the distinction between www, db, file, and other servers is entirely artificial. There's no such thing as a "www server" - It's a linux server running an http server application.

          The book isn't a list of recipies for different server roles, along the lines of "Set the max number of shared memory segments to X for mysql, and Y for oracle". It's a de
  • ...is a pretty savvy fellow; he's a frequent [kerneltrap.org] LKML poster and has gotten some mentions on Kernel Traffic [kerneltraffic.org].
  • by h4rr4r (612664) on Tuesday August 09 2005, @03:43PM (#13281712)
    That's easy it's just like your car. Put some huge fans in it, a window kit,some cold cathode lights and stickers, lots of stickers. That will easily double the performance. If you turn the box on its side thats good too, it gets the motherboard closer to the ground. Then some humongous plastic trim to round it all out. Don't forget to get neon heat spreaders for your ram, that lowers the latency a whole bunch.
  • by Anonymous Coward
    ...but you can't tuna fish.

  • by Jamu (852752) on Tuesday August 09 2005, @03:48PM (#13281747)

    The book is 547 pages. Of that total, 507 are the content of the book while 13 pages are used for an Appendix.

    Is that the best opening for a review you could come up with? Sweet Jeebus!

  • by GillBates0 (664202) on Tuesday August 09 2005, @03:50PM (#13281759) Homepage Journal
    This wasn't mentioned in the summary/review, but the book appeared in a news posting on samba.org in June [samba.org]. It contains a chapter on File and Print Server performance written by Samba team member Steve French, and the fine folks at samba.org appear to recommend the book too.

    21 June 2005 Performance Tuning for Linux Servers The new book Performance Tuning for Linux Servers from IBM Press contains a chapter on File and Print Server performance written by Samba Team member Steve French. The chapter discusses Samba and NFS performance concepts. Other chapters, especially those on networking and filesystem performance tuning for Linux, also could be helpful for Samba administrators.

  • easier way (Score:4, Funny)

    by ebatsky (582457) on Tuesday August 09 2005, @03:51PM (#13281763) Journal
    just use some wi-fi spray [ebay.com] to speed up your data transfer rates and youre all set. i plan on completely soaking my ethernet router in this stuff permantenly
  • by Anonymous Coward on Tuesday August 09 2005, @03:59PM (#13281827)
    If there's one thing that will keep this book from getting out of date it is being distro neutral. Of course that also implies being on the command line. Once you've learned to do something on the command line, you pretty much don't care what distro is on the box you're working on.

    Of course, Joe user shouldn't have to be able to cope with the command line and for such people, there's always the pointy-clicky way but that also has a learning curve. The gui way to do things is different from distro to distro so instead of a sharp learning curve to do something on the command line, you have a lot of little learning curves as you move between systems.
    • Joe User isn't performance tuning a cluster of corporate web servers, either. He's using a desktop system that won't see much if any difference from adjusting most of the stuff in /proc.
      • "Of course, Joe user shouldn't have to be able to cope with the command line... "

        They did when DOS was around.

        Good point! Back then people -- that's users, not just admins -- treated software like tools: if they wanted to use them, they learned how to use them. They didn't complain about the difficulty of the command line, even though it was worse than today's unix equivalents.

        Nowadays it seems people refuse to learn things. They expect computers to read their minds. It's like each user interfac

  • But there isnt a lot in it that you probably dont already know if you have any performance concerns. It is very dominated (unsurprisingly) by database workloads. Its ok, but doesnt say anything that important about tuning - it assumes you dont have source code access so it doesnt address the intersting questions like should I rewrite my application to use AIO.

    If you run Oracle you shoould buy it on expenses.
    • There's very little aside from the kernel to tune on a linux box, and its almost entirely vendor neutral. Thats one of the really nice aspects of linux, that you can tune a SuSe box virtually identically to a RedHat box. This is in direct contrast to the proprietary world were a Sun box has utterly different tools from an AIX box.
      • Not really. Tuning the kernel is fine, but really doesn't give you much (IMHO) compared to tuning the applications you're using.

        eg. If you're running a database server, what can you do to improve its performance (maybe buy MySQL Performance tuning), if you're running a web server what can you do (erm, buy Apache performance tuning), and err.. if you're running a file server.. then. erm.. I'll get my coat.
        • That really depends on the applications you're running. As an example, at the shop I'm at the applications we run are all custom in house apps, and there's no tuning to perform on them. We have gotten some pretty significant performance out of tuning things like bdflush and some other paramters. I agree though that for some applications its not really worthwhile to spend much time tuning the kernel when the bulk of your performance can be picked up in the application. I've picked up some pretty immense perf
    • Can someone who knows more about the subject than I comment on the usefulness of distro specific tuning?

      I really don't think you'd achieve much. Fundamentally, a Linux system is a bunch of programs running on a Linux kernel. A distribution dictates to a greater or lesser extent how those programs are installed and how the system as a whole is configured and managed, and may include some GUI-based tool to make it easier but is unlikely to have any special black magic to make it run much faster.

      IMO, you'd be
    • It's a lot more than that. There may be a distro or 2 out there that offers a variety of tuning profiles, but the fact is that one distro will typically be tuned for one style of hardware profile. If it's half decent you'll get enough documentation to tune it yourself, but you'll probably still have to look for it...

      Fact: RedHat EL3's default httpd configuration is AWFUL for busy websites on high end machines, compared to say Windows/IIS defaults, though on cheap/low powered hardware running with a 300M