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.
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.
a) Install FreeBSD.
b) Reboot.
Trolling is a art,
In my experience, the number one tip for linux performance tuning is "man elvtune". I've seen it work miracles.
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 in the next edition. No plug is as shameless as when you do it in person. ;)
The filesystem is the package manager
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?
Looking for a job?
Want your resume written professionally?
DON'T USE TUNAREZ!!!
...is a pretty savvy fellow; he's a frequent LKML poster and has gotten some mentions on Kernel Traffic.
The Army reading list
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.
...but you can't tuna fish.
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!
Who ordered that?
TFA makes it sound like the book focuses primarily on kernel tuning. Can someone who knows more about the subject than I comment on the usefulness of distro specific tuning? I'm just curious if the tuning capabilities of the different products vary greatly. (I'd imagine they would but I'm not sure to what extent....)
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.
An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
just use some wi-fi spray to speed up your data transfer rates and youre all set. i plan on completely soaking my ethernet router in this stuff permantenly
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.
It's worth it, for the better network performance
You forgot the spoiler... a big, honking spoiler on the back
You can't talk about Wikipedia's flaws on Wikipedia
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...
"You should always go to other people's funerals; otherwise, they won't come to yours." -- Yogi Berra
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)
Linux, unlike Windows ( cough cough ), is built on Unix standards so a linux 2.0 command is the same as a BSD command is the same as a linux 2.6 command. Regarding GNU software .... most commands are designed to keep compatibility with existing shell scripts. And for programming .. hasen't the GP ever heard of POSIX ??
I am quite biased towards Linux but i am shocked by the number of people who think that Linux has no standards. The only standards it doesnt have is ones made by Microsoft.
Lima India November Uniform X-ray
c) Profit!
because what hunting rifle has a bayonet lug
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 300MHz CPU it would probably benchmark better. Back at the high end, tweak 4-6 settings to make more serving threads available and it will make use of that little extra RAM, and put you back ahead of the game. If you want more than that though, look at a Web Performance Tuning book.
I've also heard of tools out there which can look at your system performance (eg if you run sar) and tell you what kernel parameters you need to alter to reduce bottlenecks and improve utilisation of underused system resources. You may have to pay for such a tool, but chances are it can delay the need for upgrading to meet growth of demand.
Communism is a political system which sadly requires everyone in the world to be perfectly ethical. As such, it doesn't work. Libertarianism has similar issues, for slightly different reasons.
Me (Blog)
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.
Unfortunately, I've seen that htop is wrong half the time on it's CPU usage. If you run X (of course, you wouldn't on a server, but whatever...) get gkrellm. It's got a much more accurate counter.
Software is like sex. It's better when it's free. -Linus Torvalds
Anyone seen a good webpage or book on Freebsd 5 tuning? Sendmail is kicking the sh*t out of my Freebsd 5 boxes where on lunix it runs fine.
Microsoft makes standards?
Game! - Where the stick is mightier than the sword!
You're such beginnaz. You forgot to change the filter pipe to the air intakes so you get more compression and +3HP on the cooling fans.
...may I add, Joe user does not tune performance. So that's actually a non-issue.
Just adding to your point.