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.
I realize you're trolling but the only thing an unbiased engineer could claim with regards to the two OSes is that FreeBSD has perhaps slightly better security.
Performance wise they're similar and many even feel Linux has a slight edge (especially recent colonels).
If you "get" pointers add me as a friend (116)!
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!!!
Lol internet: OS X is highly tuned to fit the hardware, it's even easier for apple's engineers to do this. Read some Tanenbaum once in your life, moron.
...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.
Anyone?
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
Yeah you'd think with all that time they save by not having to deal with a billion pieces of hardware that they'd be able to make a decent os.
How about the performance of Solaris 10 compared to Linux? How close can Linux come to the performance of Solaris? Too bad there isn't a nice Gentoo Open Solaris distribution.
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.
Did no one else find a problem with this line?
"The book is 547 pages. Of that total, 507 are the content of the book while 13 pages are used for an Appendix."
Uhhh..?
You forgot the spoiler... a big, honking spoiler on the back
You can't talk about Wikipedia's flaws on Wikipedia
Of the commands I use a lot, I can't think of any that quit working as I have upgraded systems. Do you know any important commands that quit working at some point?
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?
OS X is more open than Linux (BSD license is FAR FAR superior to the communist style GPL)
Communists are fine people (I mean real Communists, not those red painted fascists in former USSSR and PR China
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.
Why do you believe it is so easy to screw things up without deep understanding ? These are all just text files. How hard is it to copy the original back ? People say the same things about working on their own cars sometimes, but at least in that case there is a potential real cost to screwing up.
That said, you are right that in many cases it is easier to buy more hardware than configure more efficiently. However, anyone who gets marginal payback from intense use of the server will find that these techniques can make the difference between profit and bankruptcy.
For example, suppose you were one of the myriad horde of cheap web hosting providers. You know, the guys who sell 50 MB of disk space and a cpanel interface to a Redhat/Fedora server that is the cheapest rackmount they could find at Dell's refurbished outlet or ebay.
If you look at your bill for bandwidth, power, etc, then at the default configuration the monthly payments of a few bucks a month come out even -- that's how competitive the market is.
If you do a few small things and squeeze 20 percent more accounts onto each machine, all of a sudden you are making more than the bills each month.
If you want to hire someone who REALLY knows how to optimize a server, you should look for someone in the porn/spam industry (unfortunately).
Is it some sort of interrupt thing related to using the network a lot ? Or the disk ? How do you fiugre out WHY the computer is so slow, and where the load is coming from ?
Also, any comments on this other book -- is it worth getting in addition to the one reveiwed here ? Optimizing Linux Performance: A Hands-on Guide to Linux Performance Tools
Thanks in advance.
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.
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.
Capitalism is a system which assumes everyone is ethical too, however, the definition of ethics in both systems is exactly opposite! Communism projects living for others as the ultimate ideal (which is so obviously wrong that it can't be achieved - and hence its failure), while on the other hand capitalism requires everyone to be totally selfish , which means you live for your own good (and at the same time not sacrificing others for your purposes.) For detailed analysis of the true face of capitalism refer to Ayn Rand's work
...may I add, Joe user does not tune performance. So that's actually a non-issue.
Just adding to your point.