Título/Title Nome/Name Cargo/Position Foto/ Picture Linux Performance on Power Breno Leitão Software Engineer
2 Performance concepts. What is performance? –Low Latency –High volume –Low CPU Usage Where can you change? –Change the application –Change the environment –Find where in the hardware is the bottleneck. –At what price?
3 Where to tune? Hardware options Virtual machine parameters Kernel parameters Memory parameters TCP parameters Virtual Database parameters JVM parameters Not an easy and quick process
4 Step by Step 1) Reproduce the problem 1) Find a problem subset that quickly reproduces the problem. 2) Profile and collect information. 1) Creates a script that do run and collect information automatically 3) Analyze the problem, and find the possible points that are affecting the performance. 1) Narrow down 4) One change at time. Brute force is not the right way
5 Linux Performance Linux on Power == Linux
6 Linux Performance Tools and Profilers: –Iostat –Sar –Perf –SystemTap –Oprofile –Linux Performance Customer Profiler Utility (lpcpu)
7 Non Uniform Memory Access Most of the time, servers are NUMA
8 General Linux tips Tune the application to the NUMA environment. Use a recent and supported Linux version Application and IRQ Binding is good. – CPU Migrations is bad. – Taskset and /proc/ /smp_affinity Being able to compile the source code is a good advantage. Disable unused services and modules CPUBinaryHEX x x x x8
9 Compiling tips Different Compilers: - GCC - Advanced Toolchain - IBM XL Compiler Optimization: - Use the latest architecture you are going to use the hardware. (- mcpu=power7 ) - Different level of optimizations (O1, O2, O3) - Hundreds of options (
10 Other optimizations Libraries IBM MASS (Mathematical Accelerator Subsystem) IBM ESSL (Engineering Scientific Subsystem Library) Link-Time optimization (LTO) Post Time Optimization FDPR (Feedback-Directed Program Re-structuring) IBM SDK for PowerLinux
11 Network Optimizations Memory buffers net.ipv4.tcp_rmem net.ipv4.tcp_wmem TCP Windows Scaling net.ipv4.tcp_window_scaling Congestion Control CUBIC, Vegas, Reno, BIC, Hybla, Tahoe, etc NIC Tunning Queue size, MTU, Offloads (CRC, GSO, LRO)
12 Memory Optimization Huge Pages Libhugepages Memory allocation Optimizations MicroQuill's Smartheap TCMalloc (gperftools) Linux uses all the memory, with cache/buffers, and this is a good thing.
13 Storage Optimization Technologies ISCSI FCoE SAS SSD File System Ext, GPFS, etc Journaling Access time (noatime)
14 IO Scheduler Orders block I/O operations will be submitted to storage volumes. Minimize Hard-disk seeks Prioritize I/O processes Guarantee that a certain request will be issue before a deadline. Schedulers NOOP Anticipatory Deadline
15 Java Optimization Memory (heap, garbage collection) (-Xms, -Xmx, -Xmn*) Compressed 64 bits references (-Xcompressedrefs) Garbage Collection (- Xgcpolicy:{optthruput,subpool,optavgpause,gencon*,bala nced,..}) Garbage Collection Threads -Xgcthreads JIT (Just-in-time) Compiler New technologies available on Linux -Xaggressive IBM HealthCenter profiler
16 Perf Profiling tool that enables you to discover about: Code profiling What code takes longer? Difference between two runs Performance counters: Hardware and Software events Cache (Hit, Miss), TLB, Cycles, Instructions A lot more.
17 Perf timechart
18 Perf demo # perf stat # perf list # perf record # perf diff
19 References DeveloperWorks Wiki Perf Introduction html SystemTap Introduction Tuning 10Gb/s Network Cards IBM PowerLinux SDK Linux Performance and Tuning Guidelines
20