版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、 Red Hat Enterprise Linux 6 Performance Tuning GuideOptimizing subsystem throughput in Red Hat Enterprise Linux 6 Edition 4.0Red Hat Subject Matter ExpertsRed Hat Enterprise Linux 6 Performance Tuning GuideOptimizing subsystem throughput in Red Hat Enterprise Linux 6 Edition 4.0Red Hat Subject Matte
2、r ExpertsEdited byDon Domingo Laura BaileyLegal NoticeCopyright 2011 Red Hat, Inc. and others.This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red
3、 Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.Red Hat, Red H
4、at Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.Linux is the registered trademark of Linus Torvalds in the United States and other countries. Java is a registered trad
5、emark of Oracle and/or its affiliates.XFS is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.MySQL is a registered trademark of MySQL AB in the United States, the European Union and other countries.Node.js is an official trademark o
6、f Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.The OpenStack Word Mark and OpenStack Logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the Uni
7、ted States and other countries and are used with the OpenStack Foundations permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.All other trademarks are the property of their respective owners.AbstractThe Performance Tuning Guide descr
8、ibes how to optimize the performance of a system running Red Hat Enterprise Linux 6. It also documents performance-related upgrades in Red Hat Enterprise Linux 6. While this guide contains procedures that are field-tested and proven, Red Hat recommends that you properly test all planned configuratio
9、ns in a testing environment before applying it to a production environment. You should also back up all your data and pre-tuning configurations.Table of ContentsTable of Contents. . . . . . . . . . . .Preface51. Document Conventions51.1. Typographic Conventions51.2. Pull-quote Conventions61.3. Notes
10、 and Warnings72. Getting Help and Giving Feedback72.1. Do You Need Help?72.2. We Need Feedback!8. . . . . . . . . . . . . . . . . . . . . . . . .Chapter 1. Overview931.1. How to read this book1.1.1. Audience1.2. Release overview1.2.1. Summary of features. New features in Red Hat Enterprise Li
11、nux .1. New in . Horizontal Scalability. Parallel Computing1.2.3. Distributed Systems. Communication. Storage. Converged Networks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12、 .Chapter 2. Red Hat Enterprise Linux 6 Performance Features2.1. 64-Bit Support2.2. Ticket Spinlocks2.3. Dynamic List Structure2.4. Tickless Kernel2.5. Control Groups2.6. Storage and File System Improvements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13、 . . . . . . . . . . . . . .Chapter 3. Monitoring and Analyzing System Performance3.1. The proc File System3.2. GNOME and KDE System Monitors3.3. Built-in Command-line Monitoring Tools3.4. Tuned and ktune3.5. Application Profilers3.5.1. SystemTap3.5.2. OProfile3.5.3. Valgrind3.5.4. Perf3.6. Red Hat
14、Enterprise MRG9910101010111212121315. . . . . . . . . . . . . . . . . . . . . . . . . . .17171718181920. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2222222324252526262728. . . . . . . . . . . . . . . . . .Chapter 4 . CPU Topology Threads Interrupts. . . . . . . . . . . . . . . . . .
15、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29. . . . .2929294.1. CPU Topology304.1.1. CPU and NUMA Topology304.1.2. Tuning CPU Performance3. Setting CPU Affinity with taskset3. Controlling NUMA Policy with numactl334.1.3. Ha
16、rdware performance policy (x86_energy_perf_policy)354.1.4. turbostat354.1.5. numastat364.1.6. NUMA Affinity Management Daemon (numad)3. Benefits of numad3. Modes of operation3.1. Using numad as a service3.2. Using numad as an executable404.2. CPU Scheduling404.2.1. Re
17、altime scheduling policies414.2.2. Normal scheduling policies414.2.3. Policy Selection424.3. Interrupts and IRQ Tuning424.4. Enhancements to NUMA in Red Hat Enterprise Linux 6434.4.1. Bare-metal and Scalability Optimizations4. Enhancements in topology-awareness4. Enhancements in Mult
18、i-processor Synchronization444.4.2. Virtualization Optimizations44. . . . . . . . . . . . . . . . . . . . . . . . .Chapter 5. Memory4 65.1. Huge Translation Lookaside Buffer (HugeTLB)465.2. Huge Pages and Transparent Huge Pages465.3. Using Valgrind to Profile Memory Usage475.3.1. Profiling Memory Us
19、age with Memcheck475.3.2. Profiling Cache Usage with Cachegrind485.3.3. Profiling Heap and Stack Space with Massif495.4. Capacity Tuning515.5. Tuning Virtual Memory53. . . . . . . . . . . . . . . . . . . . . . . . . . .Chapter 6. Input/Output6.1. Features6.2. Analysis6.3. Tools6.4. Configuration. .
20、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56. . . . .565658616.4.1. Completely Fair Queuing (CFQ)616.4.2. Deadline I/O Scheduler636.4.3. Noop64. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Chapter 7. File Systems
21、667.1. Tuning Considerations for File Systems667.1.1. Formatting Options667.1.2. Mount Options667.1.3. File system maintenance687.1.4. Application Considerations687.2. Profiles for file system performance687.3. File Systems697.3.1. The Ext4 File System697.3.2. The XFS File System70. Basic tun
22、ing for XFS70. Advanced tuning for XFS70.1. Optimizing for a large number of files7.2. Optimizing for a large number of files in a single directory7.3. Optimising for concurrency7.4. Optimising for applications that use extended attributes7.5. Optimising
23、 for sustained metadata modifications727.4. Clustering737.4.1. Global File System 273. . . . . . . . . . . . . . . . . . . . . . . . . . . . .Chapter 8. Networking768.1. Network Performance Enhancements76. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Receive Packet Steeri
24、ng (RPS)76. . . . . . . . . . . . . . . . . . . . . . . . . . . . .Receive Flow Steering76. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .getsockopt support for TCP thin- streams77. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25、 . .Transparent Proxy (TProxy) support8.2. Optimized Network Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77. . . . .77. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Socket receive buffer size788.3. Overview of Packet Rece
26、ption79. . . . . . . . . . . . . . . . . . . . . . . . .CPU/cache affinity808.4. Resolving Common Queuing/Frame Loss Issues808.4.1. NIC Hardware Buffer808.4.2. Socket Queue818.5. Multicast Considerations828.6. Receive-Side Scaling (RSS)828.7. Receive Packet Steering (RPS)838.8. Receive Flow Steering
27、 (RFS)848.9. Accelerated RFS84. . . . . . . . . . . . . . . . . . . . . . .Revision History86PrefacePreface1. Document ConventionsThis manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information.In PDF and paper editions, this manual us
28、es typefaces drawn from the Liberation Fonts set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later include the Liberation Fonts set by default.1.1. Typ
29、ographic ConventionsFour typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows.Mono-spaced BoldUsed to highlight system input, including shell commands, file names and paths. Also used to highlight key
30、s and key combinations. For example:To see the contents of the file my_next_bestselling_novel in your current working directory, enter the cat my_next_bestselling_novel command at the shell prompt and press Enter to execute the command.The above includes a file name, a shell command and a key, all p
31、resented in mono-spaced bold and all distinguishable thanks to context.Key combinations can be distinguished from an individual key by the plus sign that connects each part of a key combination. For example:Press Enter to execute the command.Press Ctrl+Alt+F2 to switch to a virtual terminal.The firs
32、t example highlights a particular key to press. The second example highlights a key combination: a set of three keys pressed simultaneously.If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in mon
33、o-spaced bold. For example:File-related classes include filesystem for file systems, file for files, and dir for directories. Each class has its own associated set of permissions.Proportional BoldThis denotes words or phrases encountered on a system, including application names; dialog-box text; lab
34、eled buttons; check-box and radio-button labels; menu titles and submenu titles. For example:Choose System Preferences Mouse from the main menu bar to launch Mouse Preferences. In the Buttons tab, select the Left-handed mouse check box and click Close to switch the primary mouse button from the left
35、 to the right (making the mouse suitable for use in the left hand).To insert a special character into a gedit file, choose Applications Accessories 7Character Map from the main menu bar. Next, choose Search Find from the Character Map menu bar, type the name of the character in the Search field and
36、click Next. The character you sought will be highlighted in the Character Table. Double-click this highlighted character to place it in the Text to copy field and then click the Copy button. Now switch back to your document and choose Edit Paste from the gedit menu bar.The above text includes applic
37、ation names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context.Mono-spaced Bold Italic or Proportional Bold ItalicWhether mono-spaced bold or proportional bold, t
38、he addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example:To connect to a remote machine using ssh, type ssh username at a shell prompt. If the remote machine is exa
39、 and your username on that machine is john, type ssh john .The mount -o remount file-system command remounts the named file system. For example, to remount the /home file system, the command is mount -o remount /home.To see the version of a currently installed package, use the rp
40、m -q package command. It will return a result as follows: package-version-release.Note the words in bold italics above: username, , file-system, package, version and release.Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system.As
41、ide from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example:Publican is a DocBook publishing system.1.2. Pull-quote ConventionsTerminal output and source code listings are set off visually from the surrounding text. Output sent t
42、o a terminal is set in mono-spaced roman and presented thus:books_tests Desktop1downloadsimagesnotesscriptssvgsDesktopdocumentationdraftsmssphotosstuffsvnbooksSource-code listings are also set in mono-spaced roman but add syntax highlighting as follows:static int kvm_vm_ioctl_deassign_device(struct
43、kvm *kvm,struct kvm_assigned_pci_dev *assigned_dev)int r = 0;struct kvm_assigned_dev_kernel *match; mutex_lock(&kvm-lock);match = kvm_find_assigned_dev(&kvm-arch.assigned_dev_head,assigned_dev-assigned_dev_id);if (!match) printk(KERN_INFO %s: device hasnt been assigned before, so cannot be deassigne
44、dn, func );r = -EINVAL;goto out;kvm_deassign_device(kvm, match); kvm_free_assigned_device(kvm, match);out:mutex_unlock(&kvm-lock); return r;1.3. Notes and WarningsFinally, we use three visual styles to draw attention to information that might otherwise be overlooked.NoteNotes are tips, shortcuts or
45、alternative approaches to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier.ImportantImportant boxes detail things that are easily missed: configuration changes that only apply to the current session, or services tha
46、t need restarting before an update will apply. Ignoring a box labeled “Important” will not cause data loss but may cause irritation and frustration.WarningWarnings should not be ignored. Ignoring warnings will most likely cause data loss.2. Getting Help and Giving Feedback2.1. Do You Need Help?If yo
47、u experience difficulty with a procedure described in this documentation, visit the Red Hat CustomerPortal at . Through the customer portal, you can:search or browse through a knowledgebase of technical support articles about Red Hat products. submit a support case to Red Hat
48、Global Support Services (GSS).access other product documentation.Red Hat also hosts a large number of electronic mailing lists for discussion of Red Hat software and technology. You can find a list of publicly available mailing lists at /mailman/listinfo. Click on the name of an
49、y mailing list to subscribe to that list or to access the list archives.2.2. We Need Feedback!If you find a typographical error in this manual, or if you have thought of a way to make this manual better, we would love to hear from you! Please submit a report in Bugzilla: / a
50、gainst the product Red Hat Enterprise Linux 6.When submitting a bug report, be sure to mention the manuals identifier: doc- Performance_Tuning_GuideIf you have a suggestion for improving the documentation, try to be as specific as possible when describing it. If you have found an error, please inclu
51、de the section number and some of the surrounding text so we can find it easily.Chapter 1. OverviewChapter 1. OverviewThe Performance Tuning Guide is a comprehensive reference on the configuration and optimization of Red Hat Enterprise Linux. While this release also contains information on Red Hat E
52、nterprise Linux 5 performance capabilities, all instructions supplied herein are specific to Red Hat Enterprise Linux 6.1.1. How to read this bookThis book is divided into chapters discussing specific subsystems in Red Hat Enterprise Linux. ThePerformance Tuning Guide focuses on three major themes p
53、er subsystem:FeaturesEach subsystem chapter describes performance features unique to (or implemented differently in)Red Hat Enterprise Linux 6. These chapters also discuss Red Hat Enterprise Linux 6 updates that significantly improved the performance of specific subsystems over Red Hat Enterprise Li
54、nux 5.AnalysisThe book also enumerates performance indicators for each specific subsystem. Typical values for these indicators are described in the context of specific services, helping you understand their significance in real-world, production systems.In addition, the Performance Tuning Guide also
55、 shows different ways of retrieving performance data (that is, profiling) for a subsystem. Note that some of the profiling tools showcased here are documented elsewhere with more detail.ConfigurationPerhaps the most important information in this book are instructions on how to adjust the performance
56、 of a specific subsystem in Red Hat Enterprise Linux 6. The Performance Tuning Guide explains how to fine-tune a Red Hat Enterprise Linux 6 subsystem for specific services.Keep in mind that tweaking a specific subsystems performance may affect the performance of another, sometimes adversely. The default configuration of Red Hat Enterprise Linux 6 is optimal for most services running under moderate loads.The procedures enumerated in the Performance Tuning Guide were tested extensively by Red Hat engineers in both lab and field.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 长春-石家庄天然气管道项目(多伦县段)临时用地复垦方案
- 十大主题教育体系构建
- (正式版)DB15∕T 4363-2026 种植业面源污染调查技术规程
- 溧阳环保就业方向
- 2026上海复旦大学附属妇产科医院招聘工会科员1人考试模拟试题及答案解析
- 2026年马鞍山市临床检验中心招聘2名考试参考题库及答案解析
- 金圆股份环保制度
- 机械设备防锈、防腐知识(通俗版)
- 2026年合肥东部新中心建设投资有限公司招聘4名考试参考题库及答案解析
- 2026年及未来5年市场数据中国高中教育行业市场发展现状及投资前景展望报告
- 生态牛肉营销方案(3篇)
- 建设项目火灾应急演练脚本
- 2026云南省投资控股集团有限公司招聘168人笔试历年参考题库附带答案详解
- 机器学习系统与优化 课件 第一章 最优化理论
- 2025年二级造价工程师考试建设工程造价管理基础知识真题及答案解析
- 传染病知识培训试题及答案
- 2026年重大事故隐患判定标准专项培训试卷及答案
- 高中主题班会 高二上学期《学会专注、高效学习》主题班会课件
- 2025-2026学年统编版(新教材)小学道德与法治三年级下册《少让父母操心》教学课件
- 学校2026年春季学期师德师风工作计划(附每周工作行事历)
- 湖北省鄂东南五校一体联盟联考2026届数学高一下期末质量跟踪监视模拟试题含解析
评论
0/150
提交评论