Performance optimization on Linux by Peter Toth

944 views

Published on

The slides for my presentation about Peformance tuning on Linux which I presented to Auckland Linux Users Group

Published in: Engineering
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
944
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
40
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Performance optimization on Linux by Peter Toth

  1. 1. Performance optimizaton on Linux By Peter Toth peter.toth.nz@gmail.com
  2. 2. Intro What do you want to learn today? What level are you interested in? Any specific requests? Have you ever optimized Linux or an application for Linux? Assuming everyone is familiar with Linux concepts and basic architecture
  3. 3. Agenda Methodology Know your… Optimisable hardware components
  4. 4. Methodology Document Start on a clean system Empty caches - warmup caches Automate testing (clear caches every time) Step-by-step Keep those changes which are significant Establish baseline Think about side-effects Avoid trial-and-error
  5. 5. Know your ... Application Hardware Linux (environment)
  6. 6. Application Fix bugs! aka. optimize last Run at least -O2 Multi-threading Structure the program to be efficient on the hardware and Linux structure size alignment (cache-line, IO) are all POSIX/OS features used? If in doubt test!
  7. 7. Hardware Select hardware for the task Study the hardware you’ve selected: CPU, HT, memory, NUMA, SSD, disks, iGPU, TDP/SDP Tweak the SW for the HW (think SSE, AVX) Tune HW specifics through /sys
  8. 8. Linux
  9. 9. Linux interfaces Run up-to-date (OS+gcc+libs) /proc - more OS /sys - more HW sysctl kernel command_line kernel config top, ntop, iotop vmstat, iostat uname
  10. 10. Benchmark consistent benchmarking comprehensive Linux application benchmarking: Phoronix Test Suite
  11. 11. Profiling perf oprofile strace valgrind
  12. 12. CPU/NUMA Cores Caches (cache line size) Layout (physical to logical mapping) Affinity Scheduling
  13. 13. I/O Filesystem: ext4, xfs, btrfs Scheduling: noop, cfq, deadline hdparm queues buffers IO block size spinning media vs SSD AIO
  14. 14. Memory page size huge pages madvise swapping page cache memory overcommiting page faults memory fragmentation
  15. 15. Power Management consolidate old hw -> virtualize scheduler powertop turn off unused hardware (isolcpus, network) scheduler (use tickless) C states P states: frequency-voltage combinations
  16. 16. Networking Throughput or latency (RT Linux?) use your HW verify link speeds segmentation offload network buffers per socket buffers zero copy TCP congestion control algorithms tools: ethtool, iperf, netstat, wireshark!
  17. 17. Thank You! Questions?

×