°Ô½Ã¹° 1,369°Ç
   
Redhat Enterprise Linux Performance Tuning Guide - PDF ÆÄÀÏ÷ºÎ
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2011-01-28 (±Ý) 09:57 Á¶È¸ : 8937
±ÛÁÖ¼Ò :
RHEL_Tuning_Guide.pdf (2.4M), Down : 46, 2011-01-28 10:00:09
                                
ÇѹøÀо¸¸ Çϳ׿ä...

Red Hat Enterprise Linux: Performance Tuning Guide
Copyright ¨Ï 2004 by Red Hat, Inc.

1801 Varsity Drive
Raleigh NC 27606-2072 USA
Phone: +1 919 754 3700
Phone: 888 733 4281
Fax: +1 919 754 3701
PO Box 13588
Research Triangle Park NC 27709 USA

This document is derived, in part, from papers by Henry Maine, Neil Horman, Rik Faith, Adrian Likins, Sherif Abdelgawad,
Ulrich Drepper,Will Cohen, and Daniel Barrange.
Red Hat is a registered trademark and the Red Hat Shadow Man logo, RPM, and the RPM logo are trademarks of Red Hat, Inc.
Linux is a registered trademark of Linus Torvalds.
IntelTM, PentiumTM, ItaniumTM, and CeleronTM are registered trademarks of Intel Corporation.
All other trademarks and copyrights referred to are the property of their respective owners.
Copyright ¨Ï 2005 by Red Hat Inc. This material may be distributed only subject to the terms and conditions set forth in the
Open Publication License, V1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).
A PDF version of this manual is available online at http://people.redhat.com/mbehm/.


¸ñÂ÷ 
Table of Contents
Preface.................................................................................................................................................. i
1. Who this Manual is For.......................................................................................................... i
2. Document Conventions.......................................................................................................... i
3. We Need Feedback...............................................................................................................iii

1. Evidence-Based Performance Analysis and Tuning .................................................................... 1
1.1. Is the Performance Problem 5% or 50%?.......................................................................... 1
1.1.1. Avoid Jumping to Conclusions ........................................................................... 1
1.2. Evidence-Based Analysis................................................................................................... 1
1.2.1. Developing a Model............................................................................................ 2
1.2.2. Planning What Evidence to Gather..................................................................... 2
1.2.3. Gathering Evidence from the Running Application ........................................... 3
1.2.4. Analyzing the Evidence ...................................................................................... 3
1.2.5. Summarize Findings and Propose an Experiment .............................................. 5
1.3. Evidence-Based Tuning ..................................................................................................... 5

2. System Tuning Tools for Linux Servers ........................................................................................ 7
2.1. Benchmarking Utilities ...................................................................................................... 7
2.1.1. Web Server Benchmarking Tools........................................................................ 8
2.2. System-Monitoring Utilities .............................................................................................. 9
2.3. Kernel Monitoring Utilities.............................................................................................. 11
2.4. Disk Benchmarking and Monitoring Utilities.................................................................. 12
2.5. Memory Monitoring Utilities........................................................................................... 13
2.6. Network Monitoring Utilities .......................................................................................... 15
2.7. Tools for Improving Application Performance................................................................ 16
2.7.1. Pointer-Use Errors ............................................................................................ 17
2.7.2. Tools for NPTL................................................................................................. 18

3. Understanding the Virtual Memory Management System....................................................... 21
3.1. Virtual Memory Terminology .......................................................................................... 21
3.1.1. What Comprises a VM...................................................................................... 21
3.1.2. Memory Management Unit (MMU)................................................................. 22
3.1.3. Zoned Buddy Allocator..................................................................................... 23
3.1.4. Slab Allocator ................................................................................................... 24
3.1.5. Kernel Threads.................................................................................................. 24
3.1.6. Components that Use the VM........................................................................... 26
3.2. The Life of A Page........................................................................................................... 26
3.3. Tuning the VM................................................................................................................. 28
3.3.1. bdush............................................................................................................... 28
3.3.2. dcache_priority ................................................................................................. 29
3.3.3. hugetlb_pool ..................................................................................................... 29
3.3.4. inactive_clean_percent...................................................................................... 30
3.3.5. kswapd .............................................................................................................. 30
3.3.6. max_map_count................................................................................................ 30
3.3.7. max-readahead .................................................................................................. 30
3.3.8. min-readahead................................................................................................... 31
3.3.9. overcommit_memory........................................................................................ 31
3.3.10. overcommit_ratio ............................................................................................ 31
3.3.11. pagecache........................................................................................................ 31
3.3.12. page-cluster ..................................................................................................... 32

4. Tuning Linux Servers ................................................................................................................... 33
4.1. Reducing System Load .................................................................................................... 33
4.1.1. Avoiding Swapping........................................................................................... 34
4.1.2. ptys and ttys ...................................................................................................... 35
4.2. Disk Tuning...................................................................................................................... 35
4.2.1. SCSI Tuning...................................................................................................... 36
4.2.2. Read-ahead........................................................................................................ 37
4.2.3. File System Fragmentation ............................................................................... 37
4.2.4. Tuning the ext2 File System ............................................................................. 38
4.2.5. Tuning the ext3 File System ............................................................................. 38
4.2.6. Creating a Software RAID Device.................................................................... 38
4.2.7. Use a Red Hat Global File System (GFS) ........................................................ 40
4.3. Virtual Memory System Tuning ...................................................................................... 40
4.3.1. File (IMAP, Web, etc.) Servers ......................................................................... 41
4.3.2. General Compute Server With Many Active Users .......................................... 41
4.3.3. Non-interactive (Batch) Computing Server ...................................................... 41
4.4. Kernel Tuning .................................................................................................................. 41
4.4.1. Kernel Tuning Tool ........................................................................................... 42
4.4.2. Flushing Old Pages with pdush (RHEL 4) and kupdated (RHEL 3).............. 43
4.4.3. Setting bdush for Server Operation (RHEL 3) ............................................... 44
4.4.4. Disk I/O Elevators............................................................................................. 45
4.4.5. File Descriptor Limits....................................................................................... 46
4.5. Network Interface Card Tuning ....................................................................................... 47
4.5.1. Network Interface Conguration ...................................................................... 47
4.5.2. Ethernet Channel Bonding................................................................................ 47
4.6. TCP Tuning...................................................................................................................... 48
4.6.1. When a CPU is Overloaded by TCP................................................................. 49
4.7. NFS Tuning...................................................................................................................... 50
4.7.1. Tuning NFS Buffer Sizes .................................................................................. 50
4.7.2. NFS over UDP .................................................................................................. 51
4.8. Java Tuning ...................................................................................................................... 51
4.9. Apache Conguration ...................................................................................................... 52
4.9.1. Conguring Apache for Benchmark Scores ..................................................... 52
4.9.2. Compiling Apache 2.0 for Your Environment .................................................. 52
4.9.3. Increasing the Number of Available File Handles ............................................ 52
4.9.4. Reduce Disk Writes with noatime .................................................................... 53
4.9.5. ListenBacklog ................................................................................................... 53
4.9.6. Using Static Content Servers ............................................................................ 53
4.9.7. Proxy Usage...................................................................................................... 54
4.9.8. Samba Tuning ................................................................................................... 54
4.9.9. OpenLDAP Tuning ........................................................................................... 55

5. Increasing Performance Through System Changes................................................................... 57
5.1. Can You Upgrade Your Hardware?.................................................................................. 57
5.1.1. Red Hat Enterprise Linux 3 System Limits ...................................................... 58
5.1.2. Applications with Hardware Prerequisites........................................................ 59
5.2. Adding a Hardware RAID ............................................................................................... 59

6. Detecting and Preventing Application Memory Problems........................................................ 63
6.1. Using valgrind.................................................................................................................. 63
6.1.1. valgrind Overview............................................................................................. 64
6.1.2. valgrind Limitations and Dependencies............................................................ 64
6.1.3. Before Running valgrind................................................................................... 65
6.1.4. Running valgrind .............................................................................................. 65
6.1.5. How to Read the valgrind Error Report ............................................................ 66
6.2. Detecting Memory-Handling Problems with mudap..................................................... 66
6.2.1. Using Mudap .................................................................................................. 67
6.2.2. How to Read the libmudap Error Report........................................................ 71
6.3. Best Programming Practices ............................................................................................ 72
6.3.1. General Suggestions.......................................................................................... 72
6.3.2. Notes About C Functions.................................................................................. 73

7. Application Tuning with OProle................................................................................................ 75
7.1. OProle Installation ......................................................................................................... 75
7.2. OProle Conguration..................................................................................................... 77
7.3. Collecting And Analyzing Data....................................................................................... 78
7.4. Viewing the Overall System Prole................................................................................. 78
7.5. Examining A Single Executable's Prole........................................................................ 79
7.6. Optimizing Code.............................................................................................................. 81
7.6.1. Memory References And Data Cache Misses .................................................. 81
7.6.2. Unaligned/Partial Memory Accesses................................................................ 82
7.6.3. Branch Misprediction........................................................................................ 83
7.6.4. Instruction Cache Misses .................................................................................. 84
7.7. Cautions About OProle.................................................................................................. 84
7.8. Performance Tuning with Eclipse.................................................................................... 85
7.8.1. Conguring the OProle Daemon with the Launch Manager.......................... 85
7.8.2. Data Analysis with the OProle Perspective .................................................... 87

8. Analyzing Java Application Performance Problems Using the IBM JVM.............................. 91
8.1. Problem Scenario............................................................................................................. 91
8.2. Diagnostic Tools .............................................................................................................. 91
8.2.1. Javadump .......................................................................................................... 91
8.2.2. Heapdump......................................................................................................... 92
8.2.3. JFormat ............................................................................................................. 92
8.3. Diagnosing the Problem................................................................................................... 93
8.4. Conclusions..................................................................................................................... 95
A. PerformanceAnalysisscript........................................................................................................ 97
B. Additional Resources ................................................................................................................. 101
B.1. General Linux Tuning ................................................................................................... 101
B.2. Shared Memory/Virtual Memory.................................................................................. 101
B.3. NFS Tuning ................................................................................................................... 101
B.4. TCP Tuning ................................................................................................................... 101
B.5. mod_perl Tuning ........................................................................................................... 101
B.6. Application Tuning........................................................................................................ 101
B.7. Samba Tuning Resources .............................................................................................. 102
B.8. mod_proxy Tuning ........................................................................................................ 102
B.9. OProle Resources........................................................................................................ 102
Index................................................................................................................................................ 103

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.