© 2009 IBM Corporation IBM Systems and Technology Group Methodologies for Optimizing Linux Server Performance Sandra K. Johnson, Ph.D. IBM Systems and.

Slides:



Advertisements
Similar presentations
K T A U Kernel Tuning and Analysis Utilities Department of Computer and Information Science Performance Research Laboratory University of Oregon.
Advertisements

Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Performance Testing - Kanwalpreet Singh.
Intel® performance analyze tools Nikita Panov Idrisov Renat.
® IBM Software Group © 2010 IBM Corporation What’s New in Profiling & Code Coverage RAD V8 April 21, 2011 Kathy Chan
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
An Adaptable Benchmark for MPFS Performance Testing A Master Thesis Presentation Yubing Wang Advisor: Prof. Mark Claypool.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 11: Monitoring Server Performance.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
Measuring Performance Chapter 12 CSE807. Performance Measurement To assist in guaranteeing Service Level Agreements For capacity planning For troubleshooting.
11 MONITORING MICROSOFT WINDOWS SERVER 2003 Chapter 3.
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 14 Server and Network Monitoring.
1 I/O Management in Representative Operating Systems.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Hands-On Microsoft Windows Server 2008 Chapter 11 Server and Network Monitoring.
CH 13 Server and Network Monitoring. Hands-On Microsoft Windows Server Objectives Understand the importance of server monitoring Monitor server.
Windows Server 2008 Chapter 11 Last Update
Understanding and Managing WebSphere V5
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Hands-On Microsoft Windows Server 2008 Chapter 1 Introduction to Windows Server 2008.
Hands-On Microsoft Windows Server 2008
Chapter 2. Creating the Database Environment
MCTS Guide to Microsoft Windows Vista Chapter 11 Performance Tuning.
MCTS Guide to Microsoft Windows 7
Performance of Web Applications Introduction One of the success-critical quality characteristics of Web applications is system performance. What.
Analyzing parallel programs with Pin Moshe Bach, Mark Charney, Robert Cohn, Elena Demikhovsky, Tevi Devor, Kim Hazelwood, Aamer Jaleel, Chi- Keung Luk,
Performance Concepts Mark A. Magumba. Introduction Research done on 1058 correspondents in 2006 found that 75% OF them would not return to a website that.
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
Module 7: Fundamentals of Administering Windows Server 2008.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems CSCI-6140 – Computer Operating Systems David Goldschmidt, Ph.D.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
Chapter 2 Operating System Overview
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Profiling Memory Subsystem Performance in an Advanced POWER Virtualization Environment The prominent role of the memory hierarchy as one of the major bottlenecks.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
PARALLEL COMPUTING overview What is Parallel Computing? Traditionally, software has been written for serial computation: To be run on a single computer.
Improving Disk Throughput in Data-Intensive Servers Enrique V. Carrera and Ricardo Bianchini Department of Computer Science Rutgers University.
© 2006, National Research Council Canada © 2006, IBM Corporation Solving performance issues in OTS-based systems Erik Putrycz Software Engineering Group.
Full and Para Virtualization
Chapter 9: Networking with Unix and Linux. Objectives: Describe the origins and history of the UNIX operating system Identify similarities and differences.
Disco: Running Commodity Operating Systems on Scalable Multiprocessors Presented by: Pierre LaBorde, Jordan Deveroux, Imran Ali, Yazen Ghannam, Tzu-Wei.
Making the “Box” Transparent: System Call Performance as a First-class Result Yaoping Ruan, Vivek Pai Princeton University.
Título/Title Nome/Name Cargo/Position Foto/ Picture Linux Performance on Power Breno Leitão Software Engineer.
Maintaining and Updating Windows Server 2008 Lesson 8.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Beyond Application Profiling to System Aware Analysis Elena Laskavaia, QNX Bill Graham, QNX.
Introduction to Performance Tuning Chia-heng Tu PAS Lab Summer Workshop 2009 June 30,
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
SQL Database Management
Chapter Goals Describe the application development process and the role of methodologies, models, and tools Compare and contrast programming language generations.
The Holmes Platform and Applications
Current Generation Hypervisor Type 1 Type 2.
MCTS Guide to Microsoft Windows 7
MONITORING MICROSOFT WINDOWS SERVER 2003
Introduction of Week 3 Assignment Discussion
Chapter 2: System Structures
IS3440 Linux Security Unit 7 Securing the Linux Kernel
ColdFusion Performance Troubleshooting and Tuning
Operating Systems Chapter 5: Input/Output Management
CS703 - Advanced Operating Systems
Introduction to OProfile
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

© 2009 IBM Corporation IBM Systems and Technology Group Methodologies for Optimizing Linux Server Performance Sandra K. Johnson, Ph.D. IBM Systems and Technology Group October, 2009

IBM Systems and Technology Group © 2009 IBM Corporation October, Agenda  Background on Open Source, Linux  Performance Optimization Fundamentals and Objectives  Performance Analysis Methodology  Linux Performance Tools  General Tools Requirements  Types of Tools: CPU profiling, event tracing, resource monitoring, other tools  Optimizations for Linux Subsystems  I/O and Network  Database  Java  Linux Application Optimization Overview  References

IBM Systems and Technology Group © 2009 IBM Corporation October, Open Source Offers a Different Perspective  How and Why it Works…  Open Source development  Defect & fixes  Releases  Darwinian Nature  Community and Integrity  Release early, release often  Public Licensing  Accountability  Internal & external distribution  No Vendor Lock-in  Linux is Open Source  It does scale  It is ready for the enterprise  It runs on business apps  It is secure  There are skills available The Open Source Model is a very pragmatic way of evolving software in a rapidly changing environment. It harnesses the collective wisdom, experiences, expertise and requirements of its most demanding users to ensure that their needs are rapidly met.

IBM Systems and Technology Group © 2009 IBM Corporation October,   Community develops, debugs, maintains   Usually high quality, high performance software   Reliable, flexible, low cost   More information:   Examples of Open Source Software: ƒ ƒ Apacheweb server ƒ ƒ Eclipseapp development ƒ ƒ Gnomedesktop environment ƒ ƒ Mozilla(Netscape) browser ƒ ƒ Open Office(Star Office) productivity suite ƒ ƒ Perllanguage ƒ ƒ Sambafile/print ƒ ƒ SendMailmail server ƒ ƒ Tomcatapplication server What is Open Source?

IBM Systems and Technology Group © 2009 IBM Corporation October, Performance Optimization Fundamentals  Hardware and software configuration options  Understand performance tools and how to use them  Analysis of results obtained from the tools so suitable changes can be made to positively impact the server performance

IBM Systems and Technology Group © 2009 IBM Corporation October, Linux Server Performance Optimization Objectives  To conduct deep-dive analytical performance investigations –Provide performance testing and analysis and post results for base kernel –Measure performance and scalability of Linux via selected benchmarks; publish key benchmark results  Identify bottlenecks so developers can improve performance and scalability  Optimize the performance of Linux across the areas of hardware, firmware and software  Provide tools and utilities to the Linux community

IBM Systems and Technology Group © 2009 IBM Corporation October, Performance Analysis Methodology

IBM Systems and Technology Group © 2009 IBM Corporation October, Tools   General Tools Requirements   Types of Tools   Profile   Tracing   Monitoring

IBM Systems and Technology Group © 2009 IBM Corporation October, General Tools Requirements  Uniform set of performance tools across platforms and Linux distributions :  Ia32  Ia64  ppc64 (32 and 64-bit apps)  S390  S390x (32 and 64 bit apps)  x86-64 (32 and 64-bit apps)  Integrated with distribution  Preferably open source  Preferably no reboot required  Work correctly/uniformly in guest partitions

IBM Systems and Technology Group © 2009 IBM Corporation October, Profiling Tools  The most time-consuming and frequently used sections of a program should be optimized first; profiling tools can be used to discover these areas  Code profiling tools collect information about the code executing on the system  The system is periodically interrupted so the information can be collected.  The information is then used to analyze the performance of the code  Code profilers  kernprof  gprof  oprofile

IBM Systems and Technology Group © 2009 IBM Corporation October, oprofile   capable of profiling all parts of a running system, from the kernel to user-level code   released under the GNU GPL   consists of a kernel module and a daemon for collecting sample data, and several post-profiling tools   leverages the hardware performance counters of the CPU to enable profiling of a wide variety of interesting statistics, which can also be used for basic time-spent profiling   profiling can be started and stopped anytime   several post-profiling tools;

IBM Systems and Technology Group © 2009 IBM Corporation October, gprof  part of the GNU binutils distribution, is a well known profiler designed to monitor a program’s execution  to use gprof, a program needs to be compiled and linked with profiling enabled  when the program executes, a profile data file is generated; using the relationship between the program symbol table and the call graph profile, gprof calculates the amount of time spent in each routine and constructs the call graph for all parents and descendents.

IBM Systems and Technology Group © 2009 IBM Corporation October, gprof  Output for each function:  The flat profile shows time spent in each function, and the number of times that function was called  total execution times, the call counts, the time in msec or usec the call spent in the routine itself, as well as the routine and its descendents  The annotated source listing is a copy of the program's source code, labeled with the number of times each line of the program was executed

IBM Systems and Technology Group © 2009 IBM Corporation October, Kernprof  Developed and support by SGI  supports a number of profiling techniques  its simplest mode creates a Program Counter (PC) value histogram for the kernel  both standard timer-based sampling, and sampling based on the hardware performance counters, are supported  the use of performance counters gives a significant advantage to kernprof, as relevant performance events such as cache misses can be analyzed. 

IBM Systems and Technology Group © 2009 IBM Corporation October, Tracing Tools  Linux Trace Toolkit  Suite of tools designed to trace and extract program execution profile information –processor utilization and allocation information for a certain period of time  Consists of 4 parts –Patched kernel to enable events to be logged –Linux kernel module that stores events into its buffer and then signals the trace daemon when reaching data limits –Trace daemon that writes the data collected by the kernel module – Data decoder (visualizer) for converting and displaying trace data  LTT has support for Real Time Application Interface (RTAI), a real- time Linux extension.  LTT can also be used with Dynamic Probes (Dprobes) version 1.2 or later, to provide a universal (dynamic) tracing capability for Linux 

IBM Systems and Technology Group © 2009 IBM Corporation October, Tracing Tools  strace  Strace is a system call trace –Debugging tool which prints out a trace of all system calls made by a process/program –Program to be traced need not be recompiled for this, so it can be used on binaries for which there is no source  In the simplest case, strace runs the specified command until it exits  Intercepts and records the system calls which are called by a process and the signals which are received by a process  The name of each system call, its arguments and its return value are printed to standard error or to the file specified with the -o option  Each line in the trace contains the system call name, followed by its arguments in parentheses and its return value

IBM Systems and Technology Group © 2009 IBM Corporation October, Resource Monitoring Tools  Linux provides facilities to monitor the utilization of memory resources under /proc filesystem  / proc/meminfo and /proc/slabinfo; capture the state of the physical memory  Vmstat – virtual memory statistics  Top – process statistics  Netstat – network statistics  Systat – sar, iostat, mpstat For more information:

IBM Systems and Technology Group © 2009 IBM Corporation October, Resource Monitoring Tools – Other Tools  Lockmeter  instruments the spin locks in a multiprocessor Linux kernel  used to identify which portions of the kernel code are responsible for causing lock contention; Lockmeter allows the following statistics to be measured for each spin lock: –The fraction of the time that the lock is busy –The fraction of accesses that resulted in a conflict –The average and maximum time that the lock is held –The average and maximum time spent spinning for the lock  Performance Inspector 

IBM Systems and Technology Group © 2009 IBM Corporation October, Benchmarks used in Linux  Targeted because their workloads represent a diverse set of applications  Benchmarks  Java: SPECjbb, SPECjAppServer, SPECpower_ssj  HPC: SPECcpu, SPEComp, stream, Linpack  Networking: Netperf and netop  I/O: disk tests with SCSI and FAStT, SPECsfs  Web Server: SPECwebSSL, SPECweb  Database: TPC-C and TPC-H  Coming soon from SPEC: Service Oriented Architecture (SOA), Session Initiated Protocol (SIP), Virtualization

IBM Systems and Technology Group © 2009 IBM Corporation October, Tuning Tips: I/O and Network  Sequential Read Tuning  Increase max_readahead size using hdparm command  Read ahead is a function of page cache size  I/O Scheduler Tuning  Increase nr_requests to 1024 (improves on most I/O workloads)  NFS Tuning  bump up NFS daemons in large NFS server  larger Maximum Transmission Unit (MTU); 9000 bytes on gigabit Ethernet  Use NFS over TCP and not UDP on Linux

IBM Systems and Technology Group © 2009 IBM Corporation October, Tuning Tips: Database  Use Asynchronous I/O for database page cleaners  Raw devices (raw I/O) provide performance superior to filesystems  Using disk controllers that provide write caching can provide significant performance improvements, particularly for database logs in an OLTP environment.  Be sure to consult Linux sysctl tuning as per database vendor recommendations  The deadline I/O scheduler has proven to be best for both TPC-C and TPC-H workloads

IBM Systems and Technology Group © 2009 IBM Corporation October, Tuning Tips: Java  Can use either 32-bit and 64-bit IBM JVM  The JVM can exploit large page support provided in the 2.6 kernel  Enable large page support using –Xlp for the Java heap  Can improve performance between 6-15%  Increase the available virtual memory  Set /proc/ /mapped_base to 0x (default is 0x )  Adds approximately three more 256MB segments to the JVM – allows 3.2 GB heap  Use 32-bit JVM for smaller systems (up to 1-way to 8-way)  32-bit JVM can give 10% boost in workloads like SPECjbb  Consider using 64-bit JVM for larger systems (over 8-way systems)  For 16-way and greater, the 32-bit JVM has scaling limits which will offset the 10% speed boost

IBM Systems and Technology Group © 2009 IBM Corporation October, Linux Application Performance Tuning Application Resources Application Server JVM Native Code Linux Networking Hardware Three Levels of Performance Tuning 1: Hardware, Networking, Linux 2: Native Code, JVM 3: App Server, Resources, Application Levels 2 and 3 can be tuned independent of the operating system

IBM Systems and Technology Group © 2009 IBM Corporation October,   Top Down Approach   Treat whole System as black box   Collect performance data, analyze, identify suspected bottlenecks   Focus on bottlenecks by going one step lower, using tools, microbenchmarks, etc.   Repeat steps until bottleneck is found   Make sure other layers have been exhausted before focusing on Linux Tuning   Give Linux the benefit of the doubt by making it the last suspect, except when it is rather obvious and undeniable that the problem is Linux related Linux Application Performance Tuning

IBM Systems and Technology Group © 2009 IBM Corporation October, For more information  Johnson, S.K., Editor-in-Chief, Linux Server Performance Tuning, IBM Press, June, 2005  Ezolt, Philip G., Optimizing Linux Performance: A Hands-On Guide to Linux Performance Tools, Prentice-Hall, March,  Heger, D., and Steve Pratt, “Workload Dependent Performance Evaluation of the Linux 2.6 I/O Schedulers”, Ottawa Linux Symposium, July, 2004  Heger, D., et.al., “An Application Centric Performance Evaluation of the Linux 2.6 Operating System”, IBM Redpapers, July, 2004  Anand, V., et. Al., “Benchmarks that Model Enterprise Workloads”, Ottawa Linux Symposium, July, 2003  Johnson, S.K., Hartner, B. and Brantley, B., “Strategy for Improving Linux Kernel Performance and Scalability”, IBM DeveloperWorks, January,  Vianney, D., “Hyper-Threading Speeds Linux”, IBM DeveloperWorks, January, 2003

IBM Systems and Technology Group © 2009 IBM Corporation October, Q & A

IBM Systems and Technology Group © 2009 IBM Corporation October, oprofile   capable of profiling all parts of a running system, from the kernel to user-level code   released under the GNU GPL   consists of a kernel module and a daemon for collecting sample data, and several post-profiling tools.   For 2.2 and 2.4 Linux kernels, the module must be compiled into the kernel source tree while beginning with , oprofile has been merged with the kernel and it is enabled through a configuration selection   leverages the hardware performance counters of the CPU to enable profiling of a wide variety of interesting statistics, which can also be used for basic time-spent profiling   profiling can be started and stopped anytime   Profiles user-level code, the whole system   several post-profiling tools;