SlideShare a Scribd company logo
performance tweaks and
     tools for linux
            joe damato
      twitter: @joedamato
      blog: timetobleed.com
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
~12 hour flight
+11 hour time change

Recommended for you

Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernel

Perf is a collection of Linux kernel tools for performance monitoring and profiling. It provides sampling and profiling of the system to analyze performance bottlenecks. Perf supports hardware events from the CPU performance counters, software events from the kernel, and tracepoint events from the kernel and loaded modules. It offers tools like perf record to sample events and store them, perf report to analyze stored samples, and perf trace to trace system events in real-time.

opensuse asia summit 2017
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device Drivers

The document discusses various techniques for debugging Linux kernel modules and device drivers, including: 1) Using printk statements to output debug messages from kernel space. 2) Watching system calls with strace to debug interactions between user and kernel space. 3) Adding /proc file system entries and write functions to dynamically modify driver values at runtime. 4) Enabling source-level debugging with tools like kgdb to debug at the level of C source code.

debugginglinuxkernel
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021

Bpftrace is a relatively new eBPF-based open source tracer for modern Linux versions (kernels 5.x.y) that is useful for analyzing production performance problems and troubleshooting software. Basic usage of the tool, as well as bpftrace one liners and advanced scripts useful for MariaDB DBAs are presented. Problems of MariaDB Server dynamic tracing with bpftrace and some possible solutions and alternative tracing tools are discussed.

mariadblinuxbpftrace
and
Performance tweaks and tools for Linux (Joe Damato)
side effects are..
Performance tweaks and tools for Linux (Joe Damato)

Recommended for you

bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges

Brendan Gregg discusses the current state and future potential of BPF and BCC tools for observability in Linux. He outlines 18 areas where BPF support has progressed and 16 areas still needing work. Gregg also discusses challenges like dynamic tracing stability, overhead, ease of coding, and developing visualizations. He proposes finishing ports of his old DTrace tools and links to resources on BPF, BCC, and flame graphs.

io visor summitlinuxlinux foundation
QCon 2015 Broken Performance Tools
QCon 2015 Broken Performance ToolsQCon 2015 Broken Performance Tools
QCon 2015 Broken Performance Tools

Talk for QConSF 2015: "Broken benchmarks, misleading metrics, and terrible tools. This talk will help you navigate the treacherous waters of system performance tools, touring common problems with system metrics, monitoring, statistics, visualizations, measurement overhead, and benchmarks. This will likely involve some unlearning, as you discover tools you have been using for years, are in fact, misleading, dangerous, or broken. The speaker, Brendan Gregg, has given many popular talks on operating system performance tools. This is an anti-version of these talks, to focus on broken tools and metrics instead of the working ones. Metrics can be misleading, and counters can be counter-intuitive! This talk will include advice and methodologies for verifying new performance tools, understanding how they work, and using them successfully."

Implementing Lightweight Networking
Implementing Lightweight NetworkingImplementing Lightweight Networking
Implementing Lightweight Networking

This document discusses real-time operating systems (RTOS) and embedded systems. It provides an overview of RTOS concepts like tasks, memory management, timers, I/O, and inter-process communication. It also describes the author's work developing several RTOS projects over the years including Orz Microkernel, RT nanokernel, Jamei RTOS, and CuRT. Examples of using RTOS for applications in areas like industrial automation, wireless sensor networks, and embedded devices are also mentioned.

rtoslightweighttcp/ip
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
nasty bugs
ejpphoto (flickr)

Recommended for you

Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs

Delivered as plenary at USENIX LISA 2013. video here: https://www.youtube.com/watch?v=nZfNehCzGdw and https://www.usenix.org/conference/lisa13/technical-sessions/plenary/gregg . "How did we ever analyze performance before Flame Graphs?" This new visualization invented by Brendan can help you quickly understand application and kernel performance, especially CPU usage, where stacks (call graphs) can be sampled and then visualized as an interactive flame graph. Flame Graphs are now used for a growing variety of targets: for applications and kernels on Linux, SmartOS, Mac OS X, and Windows; for languages including C, C++, node.js, ruby, and Lua; and in WebKit Web Inspector. This talk will explain them and provide use cases and new visualizations for other event types, including I/O, memory usage, and latency.

Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005

This document summarizes a presentation about tuning parallel code on Solaris. It discusses: 1) Using tools like DTrace, prstat, and vmstat to analyze performance issues like thread scheduling and I/O problems in parallel applications on Solaris. 2) Two examples of using DTrace to analyze thread scheduling and troubleshoot I/O performance problems in a virtualized Windows server. 3) How the examples demonstrated using DTrace to identify unbalanced thread scheduling and discover that a domain controller was disabling disk write caching, slowing performance.

Open Source Systems Performance
Open Source Systems PerformanceOpen Source Systems Performance
Open Source Systems Performance

This document discusses the evolution of systems performance analysis tools from closed source to open source environments. In the early 2000s with Solaris 9, performance analysis was limited due to closed source tools that provided only high-level metrics. Opening the Solaris kernel code with OpenSolaris in 2005 allowed deeper insight through understanding undocumented metrics and dynamic tracing tools like DTrace. This filled observability gaps across the entire software stack. Modern performance analysis leverages both traditional Unix tools and new dynamic tracing tools. With many high-resolution metrics available, the focus is on visualization and collecting metrics across cloud environments. Overall open source improved systems analysis by providing full source code access.

performance
fatboyke (flickr)
                    code
memory bloat
37prime (flickr)
?
TOOLS

Recommended for you

Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt

Ftrace is the official tracer of the Linux kernel. It has been apart of Linux since 2.6.31, and has grown tremendously ever since. Ftrace’s name comes from its most powerful feature: function tracing. But the ftrace infrastructure is much more than that. It also encompasses the trace events that are used by perf, as well as kprobes that can dynamically add trace events that the user defines. This talk will focus on learning how the kernel works by using the ftrace infrastructure. It will show how to see what happens within the kernel during a system call; learn how interrupts work; see how ones processes are being scheduled, and more. A quick introduction to some tools like trace-cmd and KernelShark will also be demonstrated. Steven Rostedt, VMware

linux kernelftrace
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compact

Linux Capabilities: A better root than SUID root Presented at LinuxCon2014, Düsseldorf, Oct. 15th 2014

privilegessuidfedora
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix

This document provides an overview of Brendan Gregg's presentation on BPF performance analysis at Netflix. It discusses: - Why BPF is changing the Linux OS model to become more event-based and microkernel-like. - The internals of BPF including its origins, instruction set, execution model, and how it is integrated into the Linux kernel. - How BPF enables a new class of custom, efficient, and safe performance analysis tools for analyzing various Linux subsystems like CPUs, memory, disks, networking, applications, and the kernel. - Examples of specific BPF-based performance analysis tools developed by Netflix, AWS, and others for analyzing tasks, scheduling, page faults

bpflinuxperformance
LSOF
   list open files


lsof -nPp <pid>
lsof -nPp <pid>
-n
Inhibits the conversion of network numbers to host names.

-P
Inhibits the conversion of port numbers to names for network files


   FD    TYPE   NAME                                             json
  cwd     DIR   /var/www/myapp                               memcached
  txt     REG   /usr/bin/ruby                                   mysql
  mem     REG   /json-1.1.9/ext/json/ext/generator.so           http
  mem     REG   /json-1.1.9/ext/json/ext/parser.so
  mem     REG   /memcached-0.17.4/lib/rlibmemcached.so
  mem     REG   /mysql-2.8.1/lib/mysql_api.so
    0u    CHR   /dev/null
    1w    REG   /usr/local/nginx/logs/error.log
    2w    REG   /usr/local/nginx/logs/error.log
    3u   IPv4   10.8.85.66:33326->10.8.85.68:3306 (ESTABLISHED)
   10u   IPv4   10.8.85.66:33327->10.8.85.68:3306 (ESTABLISHED)
   11u   IPv4   127.0.0.1:58273->127.0.0.1:11211 (ESTABLISHED)
   12u    REG   /tmp/RackMultipart.28957.0
   33u   IPv4   174.36.83.42:37466->69.63.180.21:80 (ESTABLISHED)
STRACE
    trace system calls and signals


      strace -cp <pid>
strace -ttTp <pid> -o <file>
strace -cp <pid>
-c
Count time, calls, and errors for each system call and report a
summary on program exit.

-p pid
Attach to the process with the process ID pid and begin tracing.


% time     seconds usecs/call      calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 50.39    0.000064           0      1197       592 read
 34.65    0.000044           0       609           writev
 14.96    0.000019           0      1226           epoll_ctl
  0.00    0.000000           0         4           close
  0.00    0.000000           0         1           select
  0.00    0.000000           0         4           socket
  0.00    0.000000           0         4         4 connect
  0.00    0.000000           0      1057           epoll_wait
------ ----------- ----------- --------- --------- ----------------
100.00    0.000127                  4134       596 total

Recommended for you

David container security-with_falco
David container security-with_falcoDavid container security-with_falco
David container security-with_falco

Falco is an open source runtime security monitor for containers that detects anomalous activity using rules. It builds on Sysdig by instrumenting the kernel and collecting system calls and events. Falco rules define suspicious behaviors and integrate signals from the kernel, containers, and Kubernetes. Falco detects threats by matching patterns in real time and alerts on suspicious activity, helping operators enforce policies and spot abnormal behavior.

OSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFOSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPF

Talk by Brendan Gregg for OSSNA 2017. "Advanced performance observability and debugging have arrived built into the Linux 4.x series, thanks to enhancements to Berkeley Packet Filter (BPF, or eBPF) and the repurposing of its sandboxed virtual machine to provide programmatic capabilities to system tracing. Netflix has been investigating its use for new observability tools, monitoring, security uses, and more. This talk will be a dive deep on these new tracing, observability, and debugging capabilities, which sooner or later will be available to everyone who uses Linux. Whether you’re doing analysis over an ssh session, or via a monitoring GUI, BPF can be used to provide an efficient, custom, and deep level of detail into system and application performance. This talk will also demonstrate the new open source tools that have been developed, which make use of kernel- and user-level dynamic tracing (kprobes and uprobes), and kernel- and user-level static tracing (tracepoints). These tools provide new insights for file system and storage performance, CPU scheduler performance, TCP performance, and a whole lot more. This is a major turning point for Linux systems engineering, as custom advanced performance instrumentation can be used safely in production environments, powering a new generation of tools and visualizations."

linuxebpfbpf
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017

Slides from a discussion at the IOVisor workshop in Feb 2017, about BPF performance and observability tools.

bpfebpf
strace -ttTp <pid> -o <file>
-tt
If given twice, the time printed will include the microseconds.

-T
Show the time spent in system calls.

-o filename
Write the trace output to the file filename rather than to stderr.


epoll_wait(9, {{EPOLLIN, {u32=68841296, u64=68841296}}}, 4096, 50) = 1 <0.033109>
accept(10, {sin_port=38313, sin_addr="127.0.0.1"}, [1226]) = 22 <0.000014>
fcntl(22, F_GETFL) = 0x2 (flags O_RDWR) <0.000007>
fcntl(22, F_SETFL, O_RDWR|O_NONBLOCK) = 0 <0.000008>
setsockopt(22, SOL_TCP, TCP_NODELAY, [1], 4) = 0 <0.000008>
accept(10, 0x7fff5d9c07d0, [1226]) = -1 EAGAIN <0.000014>
epoll_ctl(9, EPOLL_CTL_ADD, 22, {EPOLLIN, {u32=108750368, u64=108750368}}) = 0 <0.000009>
epoll_wait(9, {{EPOLLIN, {u32=108750368, u64=108750368}}}, 4096, 50) = 1 <0.000007>
read(22, "GET / HTTP/1.1r"..., 16384) = 772 <0.000012>
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 <0.000007>
poll([{fd=5, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout) <0.000008>
write(5, "1000000-0003SELECT * FROM `table`"..., 56) = 56 <0.000023>
read(5, "25101,20x234m"..., 16384) = 284 <1.300897>
http client connection
                                    read 772 bytes


 read(22, "GET / HTTP/1.1r"..., 16384) = 772 <0.0012>




      incoming http request
                                         took 0.0012s
mysql connection
                    write sql query to db


write(5, "SELECT * FROM `table`"..., 56) = 56 <0.0023>
read(5, "25101,20x234m"..., 16384) = 284 <1.30>



           read query
            response
                                            slow query
strace ruby to see some interesting things...

Recommended for you

(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014
(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014
(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014

In this session, we explain how to measure the key performance-impacting metrics in a cloud-based application and best practices for a reliable benchmarking process. Measuring the performance of applications correctly can be challenging and there are many tools available to measure and track performance. This session will provide you with specific examples of good and bad tests. We make it clear how to get reliable measurements of and how to map benchmark results to your application. We also cover the importance of selecting tests wisely, repeating tests, and measuring variability. In addition a customer will provide real-life examples of how they developed their application testing stack, utilize it for repeatable testing and identify bottlenecks.

performancecloudaws cloud
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace

This document discusses eBPF (extended Berkeley Packet Filter), which allows tracing from the Linux kernel to userspace using BPF programs. It provides an overview of eBPF including extended registers, verification, maps, and probes. Examples are given of using eBPF for tracing functions like kfree_skb() and the C library function malloc. The Berkeley Compiler Collection (BCC) makes it easy to write eBPF programs in C and Python.

linuxebpfkernel
Практический опыт профайлинга и оптимизации производительности Ruby-приложений
Практический опыт профайлинга и оптимизации производительности Ruby-приложенийПрактический опыт профайлинга и оптимизации производительности Ruby-приложений
Практический опыт профайлинга и оптимизации производительности Ruby-приложений

Алексей Туля, Senior Software Developer в Sam Solutions «Практический опыт профайлинга и оптимизации производительности Ruby-приложений» В своем докладе Алексей сделает краткий обзор различных реализаций Ruby, попытается найти причины, почему Ruby медленный. Рассмотрит вопрос сборки мусора в Ruby и вызова методов – почему в Ruby это дорого. Расскажет и покажет, что делать, чтобы поднять производительность, проведет обзор утилит для поиска проблемных мест, обзор профайлеров и расскажет, как интерпретировать результаты. Доклад в основном нацелен на практический подход по поиску проблем. Материал предназначен для пользователей Linux, поэтому все практические советы будут для ОС Linux.

ruby
stracing ruby: SIGVTALRM
    --- SIGVTALRM (Virtual   timer expired) @ 0 (0) ---
    rt_sigreturn(0x1a)        = 2207807 <0.000009>
    --- SIGVTALRM (Virtual   timer expired) @ 0 (0) ---
    rt_sigreturn(0x1a)        = 0 <0.000009>
    --- SIGVTALRM (Virtual   timer expired) @ 0 (0) ---
    rt_sigreturn(0x1a)        = 140734552062624 <0.000009>
    --- SIGVTALRM (Virtual   timer expired) @ 0 (0) ---
    rt_sigreturn(0x1a)        = 140734552066688 <0.000009>
    --- SIGVTALRM (Virtual   timer expired) @ 0 (0) ---
    rt_sigreturn(0x1a)        = 11333952 <0.000008>
    --- SIGVTALRM (Virtual   timer expired) @ 0 (0) ---
    rt_sigreturn(0x1a)        = 0 <0.000009>
    --- SIGVTALRM (Virtual   timer expired) @ 0 (0) ---
    rt_sigreturn(0x1a)        = 1 <0.000010>
    --- SIGVTALRM (Virtual   timer expired) @ 0 (0) ---


• ruby 1.8 uses signals to schedule its green threads
• process receives a SIGVTALRM signal every 10ms
stracing ruby: sigprocmask
% time     seconds usecs/call      calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.326334           0   3568567           rt_sigprocmask
  0.00    0.000000           0         9           read
  0.00    0.000000           0        10           open
  0.00    0.000000           0        10           close
  0.00    0.000000           0         9           fstat
  0.00    0.000000           0        25           mmap
------ ----------- ----------- --------- --------- ----------------
100.00    0.326334               3568685         0 total


  • debian/redhat compile ruby with --enable-pthread
  • uses a native thread timer for SIGVTALRM
  • causes excessive calls to sigprocmask: 30%
  slowdown!
TCPDUMP
   dump traffic on a network


tcpdump -i eth0 -s 0 -nqA
    tcp dst port 3306
tcpdump -i <eth> -s <len> -nqA <expr>
  tcpdump -i <eth> -w <file> <expr>
-i <eth>
Network interface.

-s <len>
Snarf len bytes of data from each packet.

-n
Don't convert addresses (host addresses, port numbers) to names.

-q
Quiet output.   Print less protocol information.

-A
Print each packet (minus its link level header) in ASCII.

-w <file>
Write the raw packets to file rather than printing them out.

<expr>
libpcap expression, for example:
  tcp src port 80
  tcp dst port 3306

Recommended for you

Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全

- The document discusses various Linux system log files such as /var/log/messages, /var/log/secure, and /var/log/cron and provides examples of log entries. - It also covers log rotation tools like logrotate and logwatch that are used to manage log files. - Networking topics like IP addressing, subnet masking, routing, ARP, and tcpdump for packet sniffing are explained along with examples.

linux
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem

The document discusses reverse engineering the firmware of Swisscom's Centro Grande modems. It identifies several vulnerabilities found, including a command overflow issue that allows complete control of the device by exceeding the input buffer, and multiple buffer overflow issues that can be exploited to execute code remotely by crafting specially formatted XML files. Details are provided on the exploitation techniques and timeline of coordination with Swisscom to address the vulnerabilities.

infosecsecuritycybsec16
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center

Michael Hennecke, Chief Technologist, HPC Storage and Networking, Lenovo DAOS User Group event, November 2020.

tcp dst port 80
19:52:20.216294 IP 24.203.197.27.40105 >
174.37.48.236.80: tcp 438
E...*.@.l.%&.....%0....POx..%s.oP.......
GET /poll_images/cld99erh0/logo.png HTTP/1.1
Accept: */*
Referer: http://apps.facebook.com/realpolls/?
_fb_q=1
tcp dst port 3306
19:51:06.501632 IP 10.8.85.66.50443 >
10.8.85.68.3306: tcp 98
E..."K@.@.Yy
.UB
.UD.....z....L............
GZ.y3b..[......W....
SELECT * FROM `votes` WHERE (`poll_id` =
72621) LIMIT 1
tcpdump -w <file>
PERFTOOLS
     google's performance tools


CPUPROFILE=/tmp/myprof ./myapp
  pprof ./myapp /tmp/myprof

Recommended for you

Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 Instances

Talk for AWS re:Invent 2014. Video: https://www.youtube.com/watch?v=7Cyd22kOqWc . Netflix tunes Amazon EC2 instances for maximum performance. In this session, you learn how Netflix configures the fastest possible EC2 instances, while reducing latency outliers. This session explores the various Xen modes (e.g., HVM, PV, etc.) and how they are optimized for different workloads. Hear how Netflix chooses Linux kernel versions based on desired performance characteristics and receive a firsthand look at how they set kernel tunables, including hugepages. You also hear about Netflix’s use of SR-IOV to enable enhanced networking and their approach to observability, which can exonerate EC2 issues and direct attention back to application performance.

ec2 performance aws
hacking-embedded-devices.pptx
hacking-embedded-devices.pptxhacking-embedded-devices.pptx
hacking-embedded-devices.pptx

The document summarizes Maycon Vitali's presentation on hacking embedded devices. It includes an agenda covering extracting firmware from devices using tools like BusPirate and flashrom, decompressing firmware to view file systems and binaries, emulating binaries using QEMU, reverse engineering code to find vulnerabilities, and details four vulnerabilities discovered in Ubiquiti networking devices designated as CVEs. The presentation aims to demonstrate common weaknesses in embedded device security and how tools can be used to analyze and hack these ubiquitous connected systems.

A little systemtap
A little systemtapA little systemtap
A little systemtap

This document discusses the Linux tracing tool systemtap. It provides an overview of systemtap and what it can be used for, including tracing system calls, kernel functions, and application functions. It also discusses how systemtap works, how it uses debugging symbols, and how RPMs handle separate debug information files. Several examples are given of using systemtap probes to trace requests for Nginx, cURL, Redis, MySQL, and TCP retransmissions. The document concludes by mentioning using DTrace for other languages beyond C, such as MySQL, Python, and Java.

systemtap
wget http://google-perftools.googlecode.com/files/google-
perftools-1.6.tar.gz                                 download
tar zxvf google-perftools-1.6.tar.gz
cd google-perftools-1.6

./configure --prefix=/opt
make                                                 compile
sudo make install

# for linux
export LD_PRELOAD=/opt/lib/libprofiler.so            setup

# for osx
export DYLD_INSERT_LIBRARIES=/opt/lib/libprofiler.dylib

CPUPROFILE=/tmp/ruby.prof ruby -e'                   profile
  5_000_000.times{ "hello world" }
'

pprof `which ruby` --text /tmp/ruby.prof             report
pprof ruby                pprof ruby
 ruby.prof --text           ruby.prof --gif
Total: 103 samples
    95 92.2% rb_yield_0
   103 100.0% rb_eval
    12 11.7% gc_sweep
    52 50.5% rb_str_new3
     3   2.9% obj_free
   103 100.0% int_dotimes
    12 11.7% gc_mark
Profiling MRI
                  • 10% of production
                     VM time spent in
                     rb_str_sub_bang
                  • String#sub!
                  • called from
                     Time.parse


return   unless   str.sub!(/A(d{1,2})/, '')
return   unless   str.sub!(/A( d|d{1,2})/, '')
return   unless   str.sub!(/A( d|d{1,2})/, '')
return   unless   str.sub!(/A(d{1,3})/, '')
return   unless   str.sub!(/A(d{1,2})/, '')
return   unless   str.sub!(/A(d{1,2})/, '')
Profiling EM + threads
           Total: 3763 samples
            2764 73.5% catch_timer
             989 26.3% memcpy
               3   0.1% st_lookup
               2   0.1% rb_thread_schedule
               1   0.0% rb_eval
               1   0.0% rb_newobj
               1   0.0% rb_gc_force_recycle


           • known issue: EM+threads =
            slow
           • memcpy??
           • thread context switches copy
            the stack w/ memcpy
           • EM allocates huge buffer on
            the stack
           • solution: move buffer to the
            heap

Recommended for you

A little systemtap
A little systemtapA little systemtap
A little systemtap

This document discusses the Linux tracing tool systemtap. It provides an overview of systemtap and what it can be used for, including tracing system calls, kernel functions, and application functions. It also discusses how systemtap works, how it uses debugging symbols, and how RPMs handle separate debug information files. Several examples are given of using systemtap probes to trace requests for Nginx, cURL, Redis, MySQL, and TCP retransmissions. The document suggests systemtap can be used beyond C for tracing languages like MySQL, Python and Java.

systemtap
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen

This document discusses the crash reporting mechanism in Tizen. It describes the crash client, which handles crash signals and generates crash reports. It covers Samsung's crash-work-sdk and Intel's corewatcher crash clients. It also discusses the crash server that receives reports and the CrashDB web interface. Finally, it mentions crash reason location algorithms.

Using Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance TroublesUsing Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance Troubles

Trying to figure out why your application is responding late can be difficult, especially if it is because of interference from the operating system. This talk will briefly go over how to write a C program that can analyze what in the Linux system is interfering with your application. It will use trace-cmd to enable kernel trace events as well as tracing lock functions, and it will then go over a quick tutorial on how to use libtracecmd to read the created trace.dat file to uncover what is the cause of interference to you application.

PERFTOOLS.RB
   perftools for ruby code


pprof.rb /tmp/myrbprof

                 github.com/tmm1/perftools.rb
gem install perftools.rb

RUBYOPT="-r`gem which perftools | tail -1`"
CPUPROFILE=/tmp/myrbprof
ruby myapp.rb

pprof.rb /tmp/myrbprof --text
pprof.rb /tmp/myrbprof --gif > /tmp/myrbprof.gif
require 'sinatra'
                       $ ab -c 1 -n 50 http://127.0.0.1:4567/compute
                       $ ab -c 1 -n 50 http://127.0.0.1:4567/sleep
get '/sleep' do
  sleep 0.25
  'done'                          • Sampling profiler:
end
                                    • 232 samples total
get '/compute' do                   • 83 samples were in /compute
  proc{ |n|
    a,b=0,1                         • 118 samples had /compute on
                                       the stack but were in
    n.times{ a,b = b,a+b }             another function
    b
  }.call(10_000)                    • /compute accounts for 50%
  'done'                               of process, but only 35% of
                                       time was in /compute itself
end

== Sinatra has ended his set (crowd applauds)
PROFILE: interrupts/evictions/bytes = 232/0/2152

Total: 232 samples
      83 35.8% 35.8%        118   50.9% Sinatra::Application#GET /compute
      56 24.1% 59.9%         56   24.1% garbage_collector
      35 15.1% 75.0%        113   48.7% Integer#times
CPUPROFILE_REALTIME=1
                         CPUPROFILE=app.prof
CPUPROFILE=app-rt.prof

Recommended for you

SOFA Tutorial
SOFA TutorialSOFA Tutorial
SOFA Tutorial

This slide will show you how to use SOFA to do performance analysis of CPU/GPU cooperative programs, especially programs running with deep software stacks like TensorFlow, PyTorch, etc. source code at: https://github.com/cyliustack/sofa

performancegpuai
Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨

This document provides an overview of Node.js application performance analysis and optimization as well as distributed system design. It discusses analyzing and optimizing CPU, memory, file I/O and network I/O usage. It also covers profiling Node.js applications using tools like Linux profiling tools, Node.js libraries, and V8 profiling tools. Lastly it discusses designing distributed systems using single machine and cluster approaches.

node.js;performance tune;distributed;
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql

This document discusses PostgreSQL and Solaris as a low-cost platform for medium to large scale critical scenarios. It provides an overview of PostgreSQL, highlighting features like MVCC, PITR, and ACID compliance. It describes how Solaris and PostgreSQL integrate well, with benefits like DTrace support, scalability on multicore/multiprocessor systems, and Solaris Cluster support. Examples are given for installing PostgreSQL on Solaris using different methods, configuring zones for isolation, using ZFS for storage, and monitoring performance with DTrace scripts.

redis-rb bottleneck
why is rubygems slow?
faster
     bundle
     install
• 23% spent in
  Gem::Version#<=>
• simple patch to rubygems
  improved overall install
  performance by 15%
• http://gist.github.com/
  458185
CPUPROFILE_OBJECTS=1
 CPUPROFILE=app-objs.prof
• object allocation profiler
  mode built-in
• 1 sample = 1 object
  created
• Time parsing is both
  CPU and object
  allocation intensive
• using mysql2 moves
  this to C

Recommended for you

May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt

This document discusses porting, scaling, and optimizing applications on Cray XT systems. It covers topics such as choosing compilers, profiling and debugging applications at scale, understanding CPU affinity, and improvements in the Cray Message Passing Toolkit (MPT). The document provides guidance on leveraging different compilers, collecting performance data using hardware counters and CrayPAT, understanding MPI process binding, and enhancements in MPT 4.0 related to MPI standards support and communication optimizations.

Hacking the swisscom modem
Hacking the swisscom modemHacking the swisscom modem
Hacking the swisscom modem

The document discusses hacking the Swisscom modem by exploiting default credentials to gain access. Upon login, the author runs commands to investigate the system such as viewing configuration files and mapping the internal network. Various system details are discovered including the Linux kernel version and software components.

Haproxy - zastosowania
Haproxy - zastosowaniaHaproxy - zastosowania
Haproxy - zastosowania

HAProxy is a free, open-source load balancer and proxy server. It is fast, reliable, and widely used. Some common uses of HAProxy include load balancing HTTP traffic, using access control lists to route requests, handling HTTPS traffic, load balancing MySQL databases, and proxying SSH connections. The latest version of HAProxy introduced new features like connection tracking, limiting connections per IP address, and peer synchronization between HAProxy instances. HAProxy provides high performance, flexibility, and scalability for traffic routing and distribution.

3camphaproxy
LTRACE
        trace library calls


      ltrace -cp <pid>
ltrace -ttTp <pid> -o <file>
ltrace -c ruby threaded_em.rb
         % time     seconds usecs/call      calls       function
         ------ ----------- ----------- --------- --------------------
          48.65   11.741295         617     19009 memcpy
          30.16    7.279634         831      8751 longjmp
           9.78    2.359889         135     17357 _setjmp
           8.91    2.150565         285      7540 malloc
           1.10    0.265946          20     13021 memset
           0.81    0.195272          19     10105 __ctype_b_loc
           0.35    0.084575          19      4361 strcmp
           0.19    0.046163          19      2377 strlen
           0.03    0.006272          23       265 realloc
         ------ ----------- ----------- --------- --------------------
         100.00   24.134999                 82999 total


  ltrace -ttT -e memcpy ruby threaded_em.rb
01:24:48.769408 --- SIGVTALRM (Virtual timer expired) ---
01:24:48.769616 memcpy(0x1216000, "", 1086328)   = 0x1216000 <0.000578>
01:24:48.770555 memcpy(0x6e32670, "240&343v", 1086328) = 0x6e32670 <0.000418>

01:24:49.899414 --- SIGVTALRM (Virtual timer expired) ---
01:24:49.899490 memcpy(0x1320000, "", 1082584)   = 0x1320000 <0.000628>
01:24:49.900474 memcpy(0x6e32670, "", 1086328) = 0x6e32670 <0.000479>
LTRACE/LIBDL
  trace dlopen’d library calls

ltrace -F <conf> -bg -x
   <symbol> -p <pid>

             github.com/ice799/ltrace/tree/libdl
ltrace -F <conf> -b -g -x <sym>
-b
Ignore signals.

-g
Ignore libraries linked at compile time.

-F <conf>
Read prototypes from config file.

-x <sym>
Trace calls to the function sym.




-F ltrace.conf
int mysql_real_query(addr,string,ulong);
void garbage_collect(void);
int memcached_set(addr,string,ulong,string,ulong);

Recommended for you

Dpdk performance
Dpdk performanceDpdk performance
Dpdk performance

FOSDEM15 SDN developer room talk DPDK performance How to not just do a demo with DPDK The Intel DPDK provides a platform for building high performance Network Function Virtualization applications. But it is hard to get high performance unless certain design tradeoffs are made. This talk focuses on the lessons learned in creating the Brocade vRouter using DPDK. It covers some of the architecture, locking and low level issues that all have to be dealt with to achieve 80 Million packets per second forwarding.

sdn dpdk fosdem nfv networking linux
Feb14 successful development
Feb14 successful developmentFeb14 successful development
Feb14 successful development

This document discusses reducing parsing costs and improving data fetching efficiency in Oracle databases. It recommends avoiding full parses for high-frequency SQL through binding and using PL/SQL. Parsing requires significant memory access and latching. The document also discusses how Oracle fetches data from disk buffers into memory through latch-protected access to blocks and rows, and how applications can reduce latch contention through bulk operations instead of single-row fetches. Packages help reduce PL/SQL object invalidation.

oracle odd
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014

Netflix tunes Amazon EC2 instances for maximum performance. In this session, you learn how Netflix configures the fastest possible EC2 instances, while reducing latency outliers. This session explores the various Xen modes (e.g., HVM, PV, etc.) and how they are optimized for different workloads. Hear how Netflix chooses Linux kernel versions based on desired performance characteristics and receive a firsthand look at how they set kernel tunables, including hugepages. You also hear about Netflix's use of SR-IOV to enable enhanced networking and their approach to observability, which can exonerate EC2 issues and direct attention back to application performance.

awsadvancedaws cloud
ltrace -x garbage_collect
19:08:06.436926   garbage_collect()   =   <void>   <0.221679>
19:08:15.329311   garbage_collect()   =   <void>   <0.187546>
19:08:17.662149   garbage_collect()   =   <void>   <0.199200>
19:08:20.486655   garbage_collect()   =   <void>   <0.205864>
19:08:25.102302   garbage_collect()   =   <void>   <0.214295>
19:08:35.552337   garbage_collect()   =   <void>   <0.189172>
ltrace -x mysql_real_query
mysql_real_query(0x1c9e0500,   "SET NAMES 'UTF8'", 16)         =   0   <0.000324>
mysql_real_query(0x1c9e0500,   "SET SQL_AUTO_IS_NULL=0", 22)   =   0   <0.000322>
mysql_real_query(0x19c7a500,   "SELECT * FROM `users`", 21)    =   0   <1.206506>
mysql_real_query(0x1c9e0500,   "COMMIT", 6)                    =   0   <0.000181>
ltrace -x memcached_set
memcached_set(0x15d46b80,   "Status:33",   21,   "004b",   366)   =   0   <0.01116>
memcached_set(0x15d46b80,   "Status:96",   21,   "004b",   333)   =   0   <0.00224>
memcached_set(0x15d46b80,   "Status:57",   21,   "004b",   298)   =   0   <0.01850>
memcached_set(0x15d46b80,   "Status:10",   21,   "004b",   302)   =   0   <0.00530>
memcached_set(0x15d46b80,   "Status:67",   21,   "004b",   318)   =   0   <0.00291>
memcached_set(0x15d46b80,   "Status:02",   21,   "004b",   299)   =   0   <0.00658>
memcached_set(0x15d46b80,   "Status:34",   21,   "004b",   264)   =   0   <0.00243>
GDB
 the GNU debugger


gdb <executable>
gdb attach <pid>

Recommended for you

D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance Problems

DTrace is a dynamic tracing framework that can be used to identify performance problems in MySQL. It works by inserting probes into code locations and executing scripts when the probes fire. This allows tracking of events like SQL queries, table locks, and storage engine operations without restarting MySQL. The document provides examples of using static and dynamic probes to trace queries and identify hot database tables.

mysqldtracemysqlconf
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...

HighLoad++ 2017 Зал «Калининград», 8 ноября, 15:00 Тезисы: http://www.highload.ru/2017/abstracts/2964.html Одноклассники состоят из более чем восьми тысяч железных серверов, расположенных в нескольких дата-центрах. Каждая из этих машин была специализированной под конкретную задачу - как для обеспечения изоляции отказов, так и для обеспечения автоматизированного управления инфраструктурой. ...

javaотказоустойчивостьраспределенные системы
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)

HighLoad++ 2017 Зал «Калининград», 8 ноября, 16:00 Тезисы: http://www.highload.ru/2017/abstracts/3032.html Протокол DNS на семь лет старше, чем Всемирная паутина. Стандарты RFC 882 и 883, определяющие основную функциональность системы доменных имён, появились в конце 1983 года, а первая реализация последовала уже годом позже. Естественно, что у технологии столь старой и при этом по сей день активнейшим образом используемой просто не могли не накопиться особенности, неочевидные обыкновенным пользователям. ...

синхронизация данныхпараллельная обработкаcdn
Debugging Ruby Segfaults
 test_segv.rb:4: [BUG] Segmentation fault
 ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.7.0]

                             def test
  #include "ruby.h"            require 'segv'
                               4.times do
  VALUE                          Dir.chdir '/tmp' do
  segv()                           Hash.new{ segv }[0]
  {                              end
    VALUE array[1];            end
    array[1000000] = NULL;   end
    return Qnil;
  }                          sleep 10
                             test()
  void
  Init_segv()
  {
    rb_define_method(rb_cObject, "segv", segv, 0);
  }
1. Attach to running process
 $ ps aux | grep ruby
 joe 23611 0.0 0.1      25424   7540 S Dec01 0:00 ruby test_segv.rb

 $ sudo gdb ruby 23611
 Attaching to program: ruby, process 23611
 0x00007fa5113c0c93 in nanosleep () from /lib/libc.so.6
 (gdb) c
 Continuing.

 Program received signal SIGBUS, Bus error.
 segv () at segv.c:7
 7	   array[1000000] = NULL;


2. Use a coredump
 Process.setrlimit Process::RLIMIT_CORE, 300*1024*1024
 $ sudo mkdir /cores
 $ sudo chmod 777 /cores
 $ sudo sysctl kernel.core_pattern=/cores/%e.core.%s.%p.%t

 $ sudo gdb ruby /cores/ruby.core.6.23611.1259781224
def test
  require 'segv'
  4.times do
    Dir.chdir '/tmp' do
       Hash.new{ segv }[0]
    end
  end     (gdb) where
end       #0 segv () at segv.c:7
          #1 0x000000000041f2be in    call_cfunc () at eval.c:5727
test()    ...
          #13 0x000000000043ba8c in   rb_hash_default () at hash.c:521
          ...
          #19 0x000000000043b92a in   rb_hash_aref () at hash.c:429
          ...
          #26 0x00000000004bb7bc in   chdir_yield () at dir.c:728
          #27 0x000000000041d8d7 in   rb_ensure () at eval.c:5528
          #28 0x00000000004bb93a in   dir_s_chdir () at dir.c:816
          ...
          #35 0x000000000041c444 in   rb_yield () at eval.c:5142
          #36 0x0000000000450690 in   int_dotimes () at numeric.c:2834
          ...
          #48 0x0000000000412a90 in   ruby_run () at eval.c:1678
          #49 0x000000000041014e in   main () at main.c:48
GDB.RB
  gdb with MRI hooks


gem install gdb.rb
   gdb.rb <pid>
                  github.com/tmm1/gdb.rb

Recommended for you

Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)

HighLoad++ 2017 Зал «Калининград», 8 ноября, 13:00 Тезисы: http://www.highload.ru/2017/abstracts/3010.html В этом докладе я расскажу, как BigData-платформа помогает трансформировать Почту России, как мы управляем построением и развитием платформы. Расскажу про найденные удачные решения, например, как разбиение на продукты с понятными SLA и интерфейсами между ними помогло нам сохранять управляемость с ростом масштабов проекта. ...

методологии и процессы разработки посроки и приоритетыбольшие проекты/команды
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...

HighLoad++ 2017 Зал «Кейптаун», 8 ноября, 10:00 Тезисы: http://www.highload.ru/2017/abstracts/2914.html Казалось бы, что нужно для организации тестового окружения? Тестовая железка и копия боевого окружения - и тестовый сервер готов. Но как быть, когда проект сложный? А когда большой? А если нужно тестировать одновременно много версий? А если все это вместе? Организация тестирования большого развивающегося проекта, где одновременно в разработке и тестировании около полусотни фич - достаточно непростая задача. Ситуация обычно осложняется тем, что иногда есть желание потрогать еще не полностью готовый функционал. В таких ситуациях часто возникает вопрос: "А куда это можно накатить и где покликать?" ...

devops и эксплуатацияhighload++
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...

HighLoad++ 2017 Зал «Кейптаун», 8 ноября, 18:00 Тезисы: http://www.highload.ru/2017/abstracts/2854.html Из этого доклада вы узнаете о возможностях репликации и автофейловера PostgreSQL, в том числе о возможностях, ставших доступных в PostgreSQL 10. Среди прочих, будет затронуты следующие темы: * Виды репликации и решаемые с ее помощью проблемы. * Настройка потоковой репликации. * Настройка логической репликации. * Настройка автофейловера / HA средствами Stolon и Consul. После прослушивания доклада вы сможете самостоятельно настраивать репликацию и автофейловер PostgreSQL.

базы данных и системы храненияhighload++
(gdb) ruby eval 1+2
3

(gdb) ruby eval Thread.current
#<Thread:0x1d630 run>

(gdb) ruby eval Thread.list.size
8
(gdb) ruby threads list
0x15890 main thread THREAD_STOPPED    WAIT_JOIN(0x19ef4)
0x19ef4      thread THREAD_STOPPED    WAIT_TIME(57.10s)
0x19e34      thread THREAD_STOPPED    WAIT_FD(5)
0x19dc4      thread THREAD_STOPPED    WAIT_NONE
0x19dc8      thread THREAD_STOPPED    WAIT_NONE
0x19dcc      thread THREAD_STOPPED    WAIT_NONE
0x22668      thread THREAD_STOPPED    WAIT_NONE
0x1d630 curr thread THREAD_RUNNABLE   WAIT_NONE
(gdb) ruby objects
  HEAPS            8
  SLOTS      1686252
  LIVE        893327 (52.98%)
  FREE        792925 (47.02%)

  scope         1641   (0.18%)
  regexp        2255   (0.25%)
  data          3539   (0.40%)
  class         3680   (0.41%)
  hash          6196   (0.69%)
  object        8785   (0.98%)
  array        13850   (1.55%)
  string      105350   (11.79%)
  node        742346   (83.10%)
(gdb) ruby objects strings
      140 u'lib'
      158 u'0'
      294 u'n'
      619 u''

    30503 unique strings
  3187435 bytes

Recommended for you

PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)

HighLoad++ 2017 Зал «Кейптаун», 8 ноября, 17:00 Тезисы: http://www.highload.ru/2017/abstracts/3096.html PostgreSQL is the world’s most advanced open source database. Indeed! With around 270 configuration parameters in postgresql.conf, plus all the knobs in pg_hba.conf, it is definitely ADVANCED! How many parameters do you tune? 1? 8? 32? Anyone ever tuned more than 64? No tuning means below par performance. But how to start? Which parameters to tune? What are the appropriate values? Is there a tool --not just an editor like vim or emacs-- to help users manage the 700-line postgresql.conf file? Join this talk to understand the performance advantages of appropriately tuning your postgresql.conf file, showcase a new free tool to make PostgreSQL configuration possible for HUMANS, and learn the best practices for tuning several relevant postgresql.conf parameters.

базы данных и системы храненияhighload++
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...

HighLoad++ 2017 Зал «Кейптаун», 8 ноября, 16:00 Тезисы: http://www.highload.ru/2017/abstracts/3115.html During this session we will cover the last development in ProxySQL to support regular expressions (RE2 and PCRE) and how we can use this strong technique in correlation with ProxySQL's query rules to anonymize live data quickly and transparently. We will explain the mechanism and how to generate these rules quickly. We show live demo with all challenges we got from the Community and we finish the session by an interactive brainstorm testing queries from the audience.

базы данных и системы хранения
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...

HighLoad++ 2017 Зал «Кейптаун», 8 ноября, 15:00 Тезисы: http://www.highload.ru/2017/abstracts/2957.html Расскажем о нашем опыте разработки модуля межсетевого экрана для MySQL с использованием генератора парсеров ANTLR и языка Kotlin. Подробно рассмотрим следующие вопросы: — когда и почему целесообразно использовать ANTLR; — особенности разработки ANTLR-грамматики для MySQL; — сравнение производительности рантаймов для ANTLR в рамках задачи синтаксического анализа MySQL (C#, Java, Kotlin, Go, Python, PyPy, C++); — вспомогательные DSL; — микросервисная архитектура модуля экранирования SQL; — полученные результаты.

javaпрочие языкизащита информации
def test
  require 'segv'
  4.times do
    Dir.chdir '/tmp' do
       Hash.new{ segv }[0]
    end
  end
end
            (gdb) ruby threads
test()
             0xa3e000 main curr thread THREAD_RUNNABLE WAIT_NONE
                   node_vcall     segv in test_segv.rb:5
                   node_call      test in test_segv.rb:5
                   node_call      call in test_segv.rb:5
                   node_call      default in test_segv.rb:5
                   node_call      [] in test_segv.rb:5
                   node_call      test in test_segv.rb:4
                   node_call      chdir in test_segv.rb:4
                   node_call      test in test_segv.rb:3
                   node_call      times in test_segv.rb:3
                   node_vcall     test in test_segv.rb:9
rails_warden leak
(gdb) ruby objects classes
    1197 MIME::Type
    2657 NewRelic::MetricSpec
    2719 TZInfo::TimezoneTransitionInfo
    4124 Warden::Manager
    4124 MethodOverrideForAll
    4124 AccountMiddleware
    4124 Rack::Cookies
    4125 ActiveRecord::ConnectionAdapters::ConnectionManagement
    4125 ActionController::Session::CookieStore
    4125 ActionController::Failsafe
    4125 ActionController::ParamsParser
    4125 Rack::Lock
    4125 ActionController::Dispatcher
    4125 ActiveRecord::QueryCache
    4125 ActiveSupport::MessageVerifier
    4125 Rack::Head


middleware chain leaking per request
mongrel sleeper thread
0x16814c00          thread THREAD_STOPPED    WAIT_TIME(0.47) 1522 bytes
      node_fcall    sleep in lib/mongrel/configurator.rb:285
      node_fcall    run in lib/mongrel/configurator.rb:285
      node_fcall    loop in lib/mongrel/configurator.rb:285
      node_call     run in lib/mongrel/configurator.rb:285
      node_call     initialize in lib/mongrel/configurator.rb:285
      node_call     new in lib/mongrel/configurator.rb:285
      node_call     run in bin/mongrel_rails:128
      node_call     run in lib/mongrel/command.rb:212
      node_call     run in bin/mongrel_rails:281
      node_fcall    (unknown) in bin/mongrel_rails:19


def run
  @listeners.each {|name,s|
    s.run
  }


  $mongrel_sleeper_thread = Thread.new { loop { sleep 1 } }
end
god memory leaks
(gdb) ruby objects arrays    43   God::Process
 elements instances          43   God::Watch
    94310 3                  43   God::Driver
    94311 3                  43   God::DriverEventQueue
    94314 2                  43   God::Conditions::MemoryUsage
    94316 1                  43   God::Conditions::ProcessRunning
                             43   God::Behaviors::CleanPidFile
     5369 arrays             45   Process::Status
  2863364 member elements    86   God::Metric
                            327   God::System::SlashProcPoller
many arrays with            327   God::System::Process
 90k+ elements!             406   God::DriverEvent



  5 separate god leaks fixed by Eric
   Lindvall with the help of gdb.rb!

Recommended for you

ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)

HighLoad++ 2017 Зал «Кейптаун», 8 ноября, 14:00 Тезисы: http://www.highload.ru/2017/abstracts/3114.html ProxySQL aims to be the most powerful proxy in the MySQL ecosystem. It is protocol-aware and able to provide high availability (HA) and high performance with no changes in the application, using several built-in features and integration with clustering software. During this session we will quickly introduce its main features, so to better understand how it works. We will then describe multiple use case scenarios in which ProxySQL empowers large MySQL installations to provide HA with zero downtime, read/write split, query rewrite, sharding, query caching, and multiplexing using SSL across data centers.

базы данных и системы храненияhighload++
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)

HighLoad++ 2017 Зал «Кейптаун», 8 ноября, 13:00 Тезисы: http://www.highload.ru/2017/abstracts/2954.html MySQL Replication is powerful and has added a lot of advanced features through the years. In this presentation we will look into replication technology in MySQL 5.7 and variants focusing on advanced features, what do they mean, when to use them and when not, Including. When should you use STATEMENT, ROW or MIXED binary log format? What is GTID in MySQL and MariaDB and why do you want to use them? What is semi-sync replication and how is it different from lossless semi-sync? ...

базы данных и системы храненияhighload++
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...

HighLoad++ 2017 Зал «Кейптаун», 8 ноября, 12:00 Тезисы: http://www.highload.ru/2017/abstracts/3120.html Количество разработчиков мобильных приложений Сбербанк Онлайн с начала 2016 года выросло на порядок. Для того чтобы продолжать выпускать качественный продукт, мы кардинально перестраиваем процесс разработки. Количество внутренних заказчиков тех или иных доработок в какой-то момент выросло настолько, что разработчики стали узким местом. Мы внедрили культуру разработки, которую можно условно назвать "внутренним open-source", сохранив за собой контроль над архитектурой и качеством проекта, но позволив разрабатывать новые фичи всем желающим. ...

Совместная работасистема контроля версийорганизация веток
BLEAK_HOUSE
     ruby memory leak detector


  ruby-bleak-house myapp.rb
bleak /tmp/bleak.<PID>.*.dump
                    github.com/fauna/bleak_house
• BleakHouse
    • installs a patched version of ruby: ruby-bleak-
         house
     •   unlike gdb.rb, see where objects were created
         (file:line)
     •   create multiple dumps over time with `kill -USR2
         <pid>` and compare to find leaks
191691 total objects
Final heap size 191691 filled, 220961 free
Displaying top 20 most common line/class pairs
  89513 __null__:__null__:__node__
  41438 __null__:__null__:String
  2348 ruby/site_ruby/1.8/rubygems/specification.rb:557:Array
  1508 ruby/gems/1.8/specifications/gettext-1.9.gemspec:14:String
  1021 ruby/gems/1.8/specifications/heel-0.2.0.gemspec:14:String
   951 ruby/site_ruby/1.8/rubygems/version.rb:111:String
   935 ruby/site_ruby/1.8/rubygems/specification.rb:557:String
   834 ruby/site_ruby/1.8/rubygems/version.rb:146:Array
IOPROFILE
             summarizes strace and lsof


wget http://aspersa.googlecode.com/svn/trunk/ioprofile
strace -cp <pid>

 ioprofile is a script that captures one sample of lsof output then
 starts strace for a specified amount of time.

 after strace finishes, the results are processed.

 below is an example that comes with ioprofile


$ ioprofile t/samples/ioprofile-001.txt
     total      pread       read     pwrite      write   filename
 10.094264 10.094264    0.000000   0.000000   0.000000   /data/data/abd_2dia/aia_227_228.ibd
  8.356632   8.356632   0.000000   0.000000   0.000000   /data/data/abd_2dia/aia_227_223.ibd
  0.048850   0.046989   0.000000   0.001861   0.000000   /data/data/abd/aia_instances.ibd
  0.035016   0.031001   0.000000   0.004015   0.000000   /data/data/abd/vo_difuus.ibd
  0.013360   0.000000   0.001723   0.000000   0.011637   /var/log/mysql/mysql-relay.002113
  0.008676   0.000000   0.000000   0.000000   0.008676   /data/data/master.info
  0.002060   0.000000   0.000000   0.002060   0.000000   /data/data/ibdata1
  0.001490   0.000000   0.000000   0.001490   0.000000   /data/data/ib_logfile1
  0.000555   0.000000   0.000000   0.000000   0.000555   /var/log/mysql/mysql-relay-log.info
  0.000141   0.000000   0.000000   0.000141   0.000000   /data/data/ib_logfile0
  0.000100   0.000000   0.000000   0.000100   0.000000   /data/data/abd/9fvus.ibd

Recommended for you

Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...

HighLoad++ 2017 Зал «Мумбай», 8 ноября, 18:00 Тезисы: http://www.highload.ru/2017/abstracts/2836.html При использовании Eventually Consistent распределенных баз данных нет гарантий, что чтение возвращает результаты последних изменений данных, если чтение и запись производятся на разных узлах. Это ограничивает пропускную способность системы. Поддержка свойства Causal Consistency снимает это ограничение, что позволяет улучшить масштабируемость, не требуя изменений в коде приложения. ...

mongodbраспределенные системыметоды и техника разработки по
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...

HighLoad++ 2017 Зал «Мумбай», 8 ноября, 16:00 Тезисы: http://www.highload.ru/2017/abstracts/2858.html Аудитория Одноклассников превышает 73 миллиона человек в России, СНГ и странах дальнего зарубежья. При этом ОК.ru - первая социальная сеть по просмотрам видео в рунете и крупнейшая сервисная платформа. Качественный и количественный рост DDoS-атак за последние годы превращает их в одну из первоочередных проблем для крупнейших интернет-ресурсов. В зависимости от вектора атаки “узким” местом становится та или иная часть инфраструктуры. В частности, при SYN-flood первый удар приходится на систему балансировки трафика. От ее производительности зависит успех в противостоянии атаке. ...

отказоустойчивостьоптимизация производительностиархитектуры / другое
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)

HighLoad++ 2017 Зал «Мумбай», 8 ноября, 15:00 Тезисы: http://www.highload.ru/2017/abstracts/3008.html Никогда не было и вот снова случилось! Компания Google в результате перенаправления трафика сделала недостпуными в Японии несколько тысяч различных сервисов, большинство из которых никак не связано с самой компанией Google. Однако, подобные инциденты происходят с завидной регулярностью, вот только не всегда попадают в большие СМИ. У таких инцидентов могут быть разные причины, начиная от ошибок сетевых инженеров и заканчивая государственным регулированием. ...

отказоустойчивостьраспределенные системытехнологии отказоустойчивости и катастрофоустойчив
strace -ttTp <pid> -o <file>
  -c CELL
  specify what to put in the cells of the output. ‘times’, ‘count’,
  or ‘sizes‘.

  below is an example of -c sizes:

$ ioprofile -c sizes t/samples/ioprofile-001.txt
     total      pread       read     pwrite       write   filename
  90800128   90800128          0          0           0   /data/data/abd_2dia/aia_227_223.ibd
  52150272   52150272          0          0           0   /data/data/abd_2dia/aia_227_228.ibd
    999424          0          0     999424           0   /data/data/ibdata1
    638976     131072          0     507904           0   /data/data/abd/vo_difuus.ibd
    327680     114688          0     212992           0   /data/data/abd/aia_instances.ibd
    305263          0     149662          0      155601   /var/log/mysql/mysql-relay.002113
    217088          0          0     217088           0   /data/data/ib_logfile1
     22638          0          0          0       22638   /data/data/master.info
     16384          0          0      16384           0   /data/data/abd/9fvus.ibd
      1088          0          0          0        1088   /var/log/mysql/mysql-relay-log.info
       512          0          0        512           0   /data/data/ib_logfile0
/proc
lots of interesting things hiding in proc
/proc/[pid]/pagemap

•   (as of linux 2.6.25)

•   /proc/[pid]/pagemap - find out which physical
    frame each virtual page is mapped to and swap
    flag.

•   /proc/kpagecount - stores number of times a
    particular physical page is mapped.

•   /proc/kpageflags - flags about each page (locked,
    slab, dirty, writeback, ...)

•   read more: Documentation/vm/pagemap.txt
/proc/[pid]/stack


 • get a process’s stack trace

Recommended for you

И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)

HighLoad++ 2017 Зал «Мумбай», 8 ноября, 14:00 Тезисы: http://www.highload.ru/2017/abstracts/2925.html Облака и виртуализация – современные тренды развития IT-технологий. Операторы связи строят свои TelcoClouds на стандартах NFV (Network Functions Virtualization) и SDN (Software-Defined Networking). В докладе начнем с основ виртуализации, далее разберемся, для чего используются NFV и SDN, потом полетим к облакам и вернемся на землю для решения практических задач! ...

Архитектурымасштабируемостьhighload++
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)

HighLoad++ 2017 Зал «Мумбай», 8 ноября, 10:00 Тезисы: http://www.highload.ru/2017/abstracts/3045.html Как мы заставили Druid работать в Одноклассниках. «Druid is a high-performance, column-oriented, distributed data store» http://druid.io. Мы расскажем о том, как, внедрив Druid, мы справились с ситуацией, когда MSSQL-based система статистики на 50 терабайт стала: - медленной: средняя скорость ответа была в разы меньше требуемой (и увеличилась в 20 раз); - нестабильной: в час пик статистика отставала до получаса (теперь ничего не отстает); - дорогой: изменилась политика лицензирования Microsoft, расходы на лицензии могли составить миллионы долларов. ...

javaбазы данных / другоеотказоустойчивость
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)

HighLoad++ 2017 Зал «Рио-де-Жанейро», 8 ноября, 18:00 Тезисы: http://www.highload.ru/2017/abstracts/2905.html Прошло более года с того момента, как Microsoft выпустила первую версию своего нового фреймворка для разработки web-приложений ASP.NET Core, и с каждым днем он находит все больше поклонников. ASP.NET Core базируется на платформе .NET Core, кроссплатформенной версии платформы .NET c открытым исходным кодом. Теперь у С#-разработчиков появилась возможность использовать Mac в качестве среды разработки, и запускать приложения на Linux или внутри Docker-контейнеров. ...

фреймворкипрочие языкиархитектурные паттерны
/proc/[pid]/status




• lots of small bits of information
Performance tweaks and tools for Linux (Joe Damato)
/proc/sys/kernel/core_pattern
   • tell system where to output core dumps
   • can also launch user program when
     core dumps happen.

   • echo "|/path/to/core_helper.rb %p %s %u
     %g" > /proc/sys/kernel/core_pattern

   • /proc/[pid]/ files are kept in place until your
     handler exits, so full state of the process at
     death may be inspected.

   • http://gist.github.com/587443
and lots more
  /proc/meminfo
    /proc/scsi/*
    /proc/net/*
/proc/sys/net/ipv4/*
         ...

Recommended for you

100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...

HighLoad++ 2017 Зал «Рио-де-Жанейро», 8 ноября, 14:00 Тезисы: http://www.highload.ru/2017/abstracts/2913.html Изначально будут раскрыты базовые причины, которые заставили появиться такой части механизма СУБД, как кэш результатов, и почему в ряде СУБД он есть или отсутствует. Будут рассмотрены различные варианты кэширования результатов как sql-запросов, так и результатов хранимой в БД бизнес-логики. Произведено сравнение способов кэширования (программируемые вручную кэши, стандартный функционал) и даны рекомендации, когда и в каких случаях данные способы оптимальны, а порой опасны. ...

базы данных и системы храненияhighload++
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...

HighLoad++ 2017 Зал «Рио-де-Жанейро», 8 ноября, 13:00 Тезисы: http://www.highload.ru/2017/abstracts/2947.html Apache Ignite — Open Source платформа для высокопроизводительной распределенной работы с большими данными с применением SQL или Java/.NET/C++ API. Ignite используют в самых разных отраслях. Сбербанк, ING, RingCentral, Microsoft, e-Therapeutics — все эти компании применяют решения на основе Ignite. Размеры кластеров разнятся от всего одного узла до нескольких сотен, узлы могут быть расположены в одном ЦОД-е или в нескольких геораспределенных. ...

javaбазы данных / другоеорганизация системы кеширования
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...

HighLoad++ 2017 Зал «Рио-де-Жанейро», 8 ноября, 12:00 Тезисы: http://www.highload.ru/2017/abstracts/3005.html Когда мы говорим о нагруженных системах и базах данных с большим числом параллельных коннектов, особый интерес представляет практика эксплуатации и сопровождения таких проектов. В том числе инструменты и механизмы СУБД, которые могут быть использованы DBA и DevOps-инженерами для решения задач мониторинга жизнедеятельности базы данных и ранней диагностики возможных проблем. ...

базы данных и системы храненияhighload++
MONITOR RAID STATUS
• how do you know when a hard drive in
  your RAID array fails?

• turns out there some command line tools
  that most RAID vendors provide.

• adaptec - /usr/StorMan/arcconf getconfig 1
  AL

• 3ware - /usr/bin/tw_cli
snooki:/# /usr/StorMan/arcconf getconfig 1 AL
Controllers found: 1
----------------------------------------------------------------------
Controller information
----------------------------------------------------------------------
   Controller Status                           : Optimal
   Channel description                             : SAS/SATA
   Controller Model                               : Adaptec 3405
   Controller Serial Number                           : 7C4911519E3
   Physical Slot                           :2
  Temperature                                 : 42 C/ 107 F (Normal)
   Installed memory                              : 128 MB
   Copyback                                  : Disabled
   Background consistency check                           : Enabled
  Automatic Failover                             : Enabled
   Global task priority                         : High
   Stayawake period                              : Disabled
   Spinup limit internal drives                     :0
   Spinup limit external drives                      :0
   Defunct disk drive count                          :0
   Logical devices/Failed/Degraded                      : 1/0/0
   --------------------------------------------------------
   Controller Version Information
   --------------------------------------------------------
   BIOS                                  : 5.2-0 (17304)
   Firmware                                 : 5.2-0 (17304)
   Driver                                : 1.1-5 (2461)
• write a script to parse that
• run it with cron
• the ugly ruby script i use for adaptec:
  http://gist.github.com/643666

Recommended for you

20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024

Everything that I found interesting last month about the irresponsible use of machine intelligence

quantumfaxmachine
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges

accommodate the strengths, weaknesses, threats and opportunities of autonomous vehicles

automotive self-driving car technology
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf

As a popular open-source library for analytics engineering, dbt is often used in combination with Airflow. Orchestrating and executing dbt models as DAGs ensures an additional layer of control over tasks, observability, and provides a reliable, scalable environment to run dbt models. This webinar will cover a step-by-step guide to Cosmos, an open source package from Astronomer that helps you easily run your dbt Core projects as Airflow DAGs and Task Groups, all with just a few lines of code. We’ll walk through: - Standard ways of running dbt (and when to utilize other methods) - How Cosmos can be used to run and visualize your dbt projects in Airflow - Common challenges and how to address them, including performance, dependency conflicts, and more - How running dbt projects in Airflow helps with cost optimization Webinar given on 9 July 2024

apache airflowdbtdbt-core
more well known tools:
iostat, vmstat, top, and free
LINUX TWEAKS
ADJUST TIMER FREQUENCY
CONFIG_HZ_100=y
 CONFIG_HZ=100
• Set the timer interrupt frequency.
• Fewer timer interrupts means processes
  run with fewer interruptions.
• Servers (without interactive software)
  should have lower timer frequency.

Recommended for you

Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces

An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)

augmented realitycross realityvirtual reality
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024

Everything that I found interesting about engineering leadership last month

quantumfaxmachine
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation

Manual Method of Product Research | Helium10 | MBS RETRIEVER

product researchhelium10 | mbs retriever
CONNECTOR
CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y
• connector kernel module is useful for
  process monitoring.
• build or use a system like god to watch
  processes.
• when processes die the kernel notifies you
• you can restart/recover/etc.
TCP SEGMENTATION OFFLOADING
sudo ethtool -K eth1 tso on
  • Allows kernel to offload large packet
    segmentation to the network adapter.
  • Frees the CPU to do more useful work.
  • After running the command above, verify
    with:
  [joe@timetobleed]% dmesg | tail -1

  [892528.450378] 0000:04:00.1: eth1: TSO is Enabled

Recommended for you

Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf

To help you choose the best DiskWarrior alternative, we've compiled a comparison table summarizing the features, pros, cons, and pricing of six alternatives.

data recoverydatadiskwarrior
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter

Widya Salim and Victor Ma will outline the causal impact analysis, framework, and key learnings used to quantify the impact of reducing Twitter's network latency.

What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024

This is a powerpoint that features Microsoft Teams Devices and everything that is new including updates to its software and devices for May 2024

microsoft teamsmicrosoft
http://kerneltrap.org/node/397
   Tx/Rx TCP file send long (bi-directional Rx/Tx):
   w/o TSO: 1500Mbps, 82% CPU
   w/ TSO: 1633Mbps, 75% CPU


   Tx TCP file send long (Tx only):
   w/o TSO: 940Mbps, 40% CPU
   w/ TSO: 940Mbps, 19% CPU
INTEL I/OAT DMA ENGINE
CONFIG_DMADEVICES=y
          CONFIG_INTEL_IOATDMA=y
           CONFIG_DMA_ENGINE=y
            CONFIG_NET_DMA=y

• these options enable Intel I/OAT DMA
  engine present in recent Xeon CPUs.
• increases throughput because kernel can
  offload network data copying to the DMA
  engine.
• CPU can do more useful work.
• statistics about savings can be found in
  sysfs: /sys/class/dma/
check if I/OAT is enabled
 [joe@timetobleed]% dmesg | grep ioat

 ioatdma 0000:00:08.0: setting latency timer to 64

 ioatdma 0000:00:08.0: Intel(R) I/OAT DMA Engine
 found, 4 channels, device version 0x12, driver
 version 3.64

 ioatdma 0000:00:08.0: irq 56 for MSI/MSI-X

Recommended for you

TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In

Six months into 2024, and it is clear the privacy ecosystem takes no days off!! Regulators continue to implement and enforce new regulations, businesses strive to meet requirements, and technology advances like AI have privacy professionals scratching their heads about managing risk. What can we learn about the first six months of data privacy trends and events in 2024? How should this inform your privacy program management for the rest of the year? Join TrustArc, Goodwin, and Snyk privacy experts as they discuss the changes we’ve seen in the first half of 2024 and gain insight into the concrete, actionable steps you can take to up-level your privacy program in the second half of the year. This webinar will review: - Key changes to privacy regulations in 2024 - Key themes in privacy and data governance in 2024 - How to maximize your privacy program in the second half of 2024

data privacyprivacy complianceai
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf

These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.

air force fighter planebiggest submarinezambia port
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry

Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data. The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs. Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution! Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.

cloudcloud native observabilitycloud native
DIRECT CACHE ACCESS
CONFIG_DCA=y
• I/OAT includes Direct Cache Access (DCA)
• DCA allows a driver to warm CPU cache.
• Requires driver and device support.
• Intel 10GbE driver (ixgbe) supports this
  feature.
• Must enable this feature in the BIOS.
• Some vendors hide BIOS option so you will
  need a hack to enable DCA.
DCA enable hack
get a hack to enable DCA on some vendor
locked systems:
http://github.com/ice799/dca_force


read about the hack here:
http://timetobleed.com/enabling-bios-
options-on-a-live-server-with-no-rebooting/
THROTTLE NIC INTERRUPTS

Recommended for you

RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx

Your comprehensive guide to RPA in healthcare for 2024. Explore the benefits, use cases, and emerging trends of robotic process automation. Understand the challenges and prepare for the future of healthcare automation

rpa in healthcarerpa in healthcare usarpa in healthcare industry
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides

If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights. During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to: - Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value - Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems - Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors - Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported - Look Ahead: Gain insights into where FME is headed with coordinate systems in the future Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!

How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx

How do we build an IoT product, and make it profitable? Talk from the IoT meetup in March 2024. https://www.meetup.com/iot-sweden/events/299487375/

iot
insmod e1000e.ko
InterruptThrottleRate=1
•   SOME drivers allow you to specify the interrupt throttling
    algorithm.
•   e1000e is one of these drivers.
•   Two dynamic throttling algorithms: dynamic (1) and dynamic
    conservative (3).
•   The difference is the interrupt rate for “Lowest Latency”
    traffic.
•   Algorithm 1 is more aggressive for this traffic class.
•   Read driver documentation for more information.
•   Be careful to avoid receive livelock.
PROCESS AFFINITY
Process Affinity
• Linux allows you to set which CPU(s) a
  process may run on.
• For example, set PID 123 to CPUs 4-6:
        # taskset -c 4,5,6 123
IRQ AFFINITY

Recommended for you

BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL

Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.

blockchainweb3blockchain technology
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...

Today’s digitally connected world presents a wide range of security challenges for enterprises. Insider security threats are particularly noteworthy because they have the potential to cause significant harm. Unlike external threats, insider risks originate from within the company, making them more subtle and challenging to identify. This blog aims to provide a comprehensive understanding of insider security threats, including their types, examples, effects, and mitigation techniques.

insider securitycybersecurity threatsenterprise security
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation

Java Servlet programs

IRQ Affinity
• NIC, disk, etc IRQ handlers can be set to
  execute on specific processors.
• The IRQ to CPU map can be found at:
  /proc/interrupts
• Individual IRQs may be set in the file:
  /proc/irq/[IRQ NUMBER]/smp_affinity
IRQ affinity
• Can pin IRQ handlers for devices to specific
  CPUs.
• Can then use taskset to pin important
  processes to other CPUs.
• The result is NIC and disk will not interrupt
  important processes running elsewhere.
• Can also help preserve CPU caches.
irqbalance
• http://www.irqbalance.org
• “irqbalance is a Linux* daemon that
  distributes interrupts over the processors
  and cores you have in your computer
  system.”
OPROFILE

Recommended for you

Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...

Have you noticed the OpenSSF Scorecard badges on the official Dart and Flutter repos? It's Google's way of showing that they care about security. Practices such as pinning dependencies, branch protection, required reviews, continuous integration tests etc. are measured to provide a score and accompanying badge. You can do the same for your projects, and this presentation will show you how, with an emphasis on the unique challenges that come up when working with Dart and Flutter. The session will provide a walkthrough of the steps involved in securing a first repository, and then what it takes to repeat that process across an organization with multiple repos. It will also look at the ongoing maintenance involved once scorecards have been implemented, and how aspects of that maintenance can be better automated to minimize toil.

dartflutteropenssf
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers

The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era. Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.

programmingcodingcivil engineering
CONFIG_OPROFILE=y
CONFIG_HAVE_OPROFILE=y
•   oprofile is a system wide profiler that can
    profile both kernel and application level code.
•   oprofile has a kernel driver which collects data
    from CPU registers (on x86 these are MSRs).
•   oprofile can also annote source code with
    performance information.
•   this can help you find and fix performance
    problems.
LATENCYTOP
CONFIG_LATENCYTOP=y
 • LatencyTOP helps you understand what
   caused the kernel to block a process.
nasty bugs
ejpphoto (flickr)

Recommended for you

fatboyke (flickr)
                    code
memory bloat
37prime (flickr)
TOOLS
TWEAKS

Recommended for you

Thanks.
   (spasiba ?)


  @joedamato
timetobleed.com

More Related Content

What's hot

Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
Brendan Gregg
 
Solaris Kernel Debugging V1.0
Solaris Kernel Debugging V1.0Solaris Kernel Debugging V1.0
Solaris Kernel Debugging V1.0
Jarod Wang
 
Device-specific Clang Tooling for Embedded Systems
Device-specific Clang Tooling for Embedded SystemsDevice-specific Clang Tooling for Embedded Systems
Device-specific Clang Tooling for Embedded Systems
emBO_Conference
 
Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernel
lcplcp1
 
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device Drivers
Satpal Parmar
 
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Valeriy Kravchuk
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges
IO Visor Project
 
QCon 2015 Broken Performance Tools
QCon 2015 Broken Performance ToolsQCon 2015 Broken Performance Tools
QCon 2015 Broken Performance Tools
Brendan Gregg
 
Implementing Lightweight Networking
Implementing Lightweight NetworkingImplementing Lightweight Networking
Implementing Lightweight Networking
guest6972eaf
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
Brendan Gregg
 
Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005
dflexer
 
Open Source Systems Performance
Open Source Systems PerformanceOpen Source Systems Performance
Open Source Systems Performance
Brendan Gregg
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Anne Nicolas
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compact
Alessandro Selli
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix
Brendan Gregg
 
David container security-with_falco
David container security-with_falcoDavid container security-with_falco
David container security-with_falco
Lorenzo David
 
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFOSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
Brendan Gregg
 
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017
Brendan Gregg
 
(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014
(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014
(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014
Amazon Web Services
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace
SUSE Labs Taipei
 

What's hot (20)

Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
 
Solaris Kernel Debugging V1.0
Solaris Kernel Debugging V1.0Solaris Kernel Debugging V1.0
Solaris Kernel Debugging V1.0
 
Device-specific Clang Tooling for Embedded Systems
Device-specific Clang Tooling for Embedded SystemsDevice-specific Clang Tooling for Embedded Systems
Device-specific Clang Tooling for Embedded Systems
 
Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernel
 
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device Drivers
 
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges
 
QCon 2015 Broken Performance Tools
QCon 2015 Broken Performance ToolsQCon 2015 Broken Performance Tools
QCon 2015 Broken Performance Tools
 
Implementing Lightweight Networking
Implementing Lightweight NetworkingImplementing Lightweight Networking
Implementing Lightweight Networking
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005
 
Open Source Systems Performance
Open Source Systems PerformanceOpen Source Systems Performance
Open Source Systems Performance
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compact
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix
 
David container security-with_falco
David container security-with_falcoDavid container security-with_falco
David container security-with_falco
 
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFOSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
 
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017
 
(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014
(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014
(PFC302) Performance Benchmarking on AWS | AWS re:Invent 2014
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace
 

Similar to Performance tweaks and tools for Linux (Joe Damato)

Практический опыт профайлинга и оптимизации производительности Ruby-приложений
Практический опыт профайлинга и оптимизации производительности Ruby-приложенийПрактический опыт профайлинга и оптимизации производительности Ruby-приложений
Практический опыт профайлинга и оптимизации производительности Ruby-приложений
Olga Lavrentieva
 
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
維泰 蔡
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
Cyber Security Alliance
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
Andrey Kudryavtsev
 
Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 Instances
Brendan Gregg
 
hacking-embedded-devices.pptx
hacking-embedded-devices.pptxhacking-embedded-devices.pptx
hacking-embedded-devices.pptx
ssuserfcf43f
 
A little systemtap
A little systemtapA little systemtap
A little systemtap
yang bingwu
 
A little systemtap
A little systemtapA little systemtap
A little systemtap
yang bingwu
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen
Lex Yu
 
Using Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance TroublesUsing Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance Troubles
ScyllaDB
 
SOFA Tutorial
SOFA TutorialSOFA Tutorial
SOFA Tutorial
NTU CSIE, Taiwan
 
Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨
flyinweb
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
Emanuel Calvo
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
Jeff Larkin
 
Hacking the swisscom modem
Hacking the swisscom modemHacking the swisscom modem
Hacking the swisscom modem
Cyber Security Alliance
 
Haproxy - zastosowania
Haproxy - zastosowaniaHaproxy - zastosowania
Haproxy - zastosowania
Łukasz Jagiełło
 
Dpdk performance
Dpdk performanceDpdk performance
Dpdk performance
Stephen Hemminger
 
Feb14 successful development
Feb14 successful developmentFeb14 successful development
Feb14 successful development
Connor McDonald
 
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
Amazon Web Services
 
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
MySQLConference
 

Similar to Performance tweaks and tools for Linux (Joe Damato) (20)

Практический опыт профайлинга и оптимизации производительности Ruby-приложений
Практический опыт профайлинга и оптимизации производительности Ruby-приложенийПрактический опыт профайлинга и оптимизации производительности Ruby-приложений
Практический опыт профайлинга и оптимизации производительности Ruby-приложений
 
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
 
Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 Instances
 
hacking-embedded-devices.pptx
hacking-embedded-devices.pptxhacking-embedded-devices.pptx
hacking-embedded-devices.pptx
 
A little systemtap
A little systemtapA little systemtap
A little systemtap
 
A little systemtap
A little systemtapA little systemtap
A little systemtap
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen
 
Using Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance TroublesUsing Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance Troubles
 
SOFA Tutorial
SOFA TutorialSOFA Tutorial
SOFA Tutorial
 
Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
 
Hacking the swisscom modem
Hacking the swisscom modemHacking the swisscom modem
Hacking the swisscom modem
 
Haproxy - zastosowania
Haproxy - zastosowaniaHaproxy - zastosowania
Haproxy - zastosowania
 
Dpdk performance
Dpdk performanceDpdk performance
Dpdk performance
 
Feb14 successful development
Feb14 successful developmentFeb14 successful development
Feb14 successful development
 
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
 
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
 

More from Ontico

One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
Ontico
 
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Ontico
 
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Ontico
 
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Ontico
 
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Ontico
 
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
Ontico
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Ontico
 
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Ontico
 
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
Ontico
 
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
Ontico
 
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Ontico
 
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Ontico
 
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Ontico
 
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Ontico
 
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
Ontico
 
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Ontico
 
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Ontico
 
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
Ontico
 
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Ontico
 
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Ontico
 

More from Ontico (20)

One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
 
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
 
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
 
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
 
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
 
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
 
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
 
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
 
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
 
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
 
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
 
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
 
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
 
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
 
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
 
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
 
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
 
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
 
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
 

Recently uploaded

20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 

Recently uploaded (20)

20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 

Performance tweaks and tools for Linux (Joe Damato)

  • 1. performance tweaks and tools for linux joe damato twitter: @joedamato blog: timetobleed.com
  • 4. ~12 hour flight +11 hour time change
  • 5. and
  • 15. ?
  • 16. TOOLS
  • 17. LSOF list open files lsof -nPp <pid>
  • 18. lsof -nPp <pid> -n Inhibits the conversion of network numbers to host names. -P Inhibits the conversion of port numbers to names for network files FD TYPE NAME json cwd DIR /var/www/myapp memcached txt REG /usr/bin/ruby mysql mem REG /json-1.1.9/ext/json/ext/generator.so http mem REG /json-1.1.9/ext/json/ext/parser.so mem REG /memcached-0.17.4/lib/rlibmemcached.so mem REG /mysql-2.8.1/lib/mysql_api.so 0u CHR /dev/null 1w REG /usr/local/nginx/logs/error.log 2w REG /usr/local/nginx/logs/error.log 3u IPv4 10.8.85.66:33326->10.8.85.68:3306 (ESTABLISHED) 10u IPv4 10.8.85.66:33327->10.8.85.68:3306 (ESTABLISHED) 11u IPv4 127.0.0.1:58273->127.0.0.1:11211 (ESTABLISHED) 12u REG /tmp/RackMultipart.28957.0 33u IPv4 174.36.83.42:37466->69.63.180.21:80 (ESTABLISHED)
  • 19. STRACE trace system calls and signals strace -cp <pid> strace -ttTp <pid> -o <file>
  • 20. strace -cp <pid> -c Count time, calls, and errors for each system call and report a summary on program exit. -p pid Attach to the process with the process ID pid and begin tracing. % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 50.39 0.000064 0 1197 592 read 34.65 0.000044 0 609 writev 14.96 0.000019 0 1226 epoll_ctl 0.00 0.000000 0 4 close 0.00 0.000000 0 1 select 0.00 0.000000 0 4 socket 0.00 0.000000 0 4 4 connect 0.00 0.000000 0 1057 epoll_wait ------ ----------- ----------- --------- --------- ---------------- 100.00 0.000127 4134 596 total
  • 21. strace -ttTp <pid> -o <file> -tt If given twice, the time printed will include the microseconds. -T Show the time spent in system calls. -o filename Write the trace output to the file filename rather than to stderr. epoll_wait(9, {{EPOLLIN, {u32=68841296, u64=68841296}}}, 4096, 50) = 1 <0.033109> accept(10, {sin_port=38313, sin_addr="127.0.0.1"}, [1226]) = 22 <0.000014> fcntl(22, F_GETFL) = 0x2 (flags O_RDWR) <0.000007> fcntl(22, F_SETFL, O_RDWR|O_NONBLOCK) = 0 <0.000008> setsockopt(22, SOL_TCP, TCP_NODELAY, [1], 4) = 0 <0.000008> accept(10, 0x7fff5d9c07d0, [1226]) = -1 EAGAIN <0.000014> epoll_ctl(9, EPOLL_CTL_ADD, 22, {EPOLLIN, {u32=108750368, u64=108750368}}) = 0 <0.000009> epoll_wait(9, {{EPOLLIN, {u32=108750368, u64=108750368}}}, 4096, 50) = 1 <0.000007> read(22, "GET / HTTP/1.1r"..., 16384) = 772 <0.000012> rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 <0.000007> poll([{fd=5, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout) <0.000008> write(5, "1000000-0003SELECT * FROM `table`"..., 56) = 56 <0.000023> read(5, "25101,20x234m"..., 16384) = 284 <1.300897>
  • 22. http client connection read 772 bytes read(22, "GET / HTTP/1.1r"..., 16384) = 772 <0.0012> incoming http request took 0.0012s
  • 23. mysql connection write sql query to db write(5, "SELECT * FROM `table`"..., 56) = 56 <0.0023> read(5, "25101,20x234m"..., 16384) = 284 <1.30> read query response slow query
  • 24. strace ruby to see some interesting things...
  • 25. stracing ruby: SIGVTALRM --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0x1a) = 2207807 <0.000009> --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0x1a) = 0 <0.000009> --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0x1a) = 140734552062624 <0.000009> --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0x1a) = 140734552066688 <0.000009> --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0x1a) = 11333952 <0.000008> --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0x1a) = 0 <0.000009> --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0x1a) = 1 <0.000010> --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- • ruby 1.8 uses signals to schedule its green threads • process receives a SIGVTALRM signal every 10ms
  • 26. stracing ruby: sigprocmask % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 100.00 0.326334 0 3568567 rt_sigprocmask 0.00 0.000000 0 9 read 0.00 0.000000 0 10 open 0.00 0.000000 0 10 close 0.00 0.000000 0 9 fstat 0.00 0.000000 0 25 mmap ------ ----------- ----------- --------- --------- ---------------- 100.00 0.326334 3568685 0 total • debian/redhat compile ruby with --enable-pthread • uses a native thread timer for SIGVTALRM • causes excessive calls to sigprocmask: 30% slowdown!
  • 27. TCPDUMP dump traffic on a network tcpdump -i eth0 -s 0 -nqA tcp dst port 3306
  • 28. tcpdump -i <eth> -s <len> -nqA <expr> tcpdump -i <eth> -w <file> <expr> -i <eth> Network interface. -s <len> Snarf len bytes of data from each packet. -n Don't convert addresses (host addresses, port numbers) to names. -q Quiet output. Print less protocol information. -A Print each packet (minus its link level header) in ASCII. -w <file> Write the raw packets to file rather than printing them out. <expr> libpcap expression, for example: tcp src port 80 tcp dst port 3306
  • 29. tcp dst port 80 19:52:20.216294 IP 24.203.197.27.40105 > 174.37.48.236.80: tcp 438 E...*.@.l.%&.....%0....POx..%s.oP....... GET /poll_images/cld99erh0/logo.png HTTP/1.1 Accept: */* Referer: http://apps.facebook.com/realpolls/? _fb_q=1
  • 30. tcp dst port 3306 19:51:06.501632 IP 10.8.85.66.50443 > 10.8.85.68.3306: tcp 98 E..."K@.@.Yy .UB .UD.....z....L............ GZ.y3b..[......W.... SELECT * FROM `votes` WHERE (`poll_id` = 72621) LIMIT 1
  • 32. PERFTOOLS google's performance tools CPUPROFILE=/tmp/myprof ./myapp pprof ./myapp /tmp/myprof
  • 33. wget http://google-perftools.googlecode.com/files/google- perftools-1.6.tar.gz download tar zxvf google-perftools-1.6.tar.gz cd google-perftools-1.6 ./configure --prefix=/opt make compile sudo make install # for linux export LD_PRELOAD=/opt/lib/libprofiler.so setup # for osx export DYLD_INSERT_LIBRARIES=/opt/lib/libprofiler.dylib CPUPROFILE=/tmp/ruby.prof ruby -e' profile 5_000_000.times{ "hello world" } ' pprof `which ruby` --text /tmp/ruby.prof report
  • 34. pprof ruby pprof ruby ruby.prof --text ruby.prof --gif Total: 103 samples 95 92.2% rb_yield_0 103 100.0% rb_eval 12 11.7% gc_sweep 52 50.5% rb_str_new3 3 2.9% obj_free 103 100.0% int_dotimes 12 11.7% gc_mark
  • 35. Profiling MRI • 10% of production VM time spent in rb_str_sub_bang • String#sub! • called from Time.parse return unless str.sub!(/A(d{1,2})/, '') return unless str.sub!(/A( d|d{1,2})/, '') return unless str.sub!(/A( d|d{1,2})/, '') return unless str.sub!(/A(d{1,3})/, '') return unless str.sub!(/A(d{1,2})/, '') return unless str.sub!(/A(d{1,2})/, '')
  • 36. Profiling EM + threads Total: 3763 samples 2764 73.5% catch_timer 989 26.3% memcpy 3 0.1% st_lookup 2 0.1% rb_thread_schedule 1 0.0% rb_eval 1 0.0% rb_newobj 1 0.0% rb_gc_force_recycle • known issue: EM+threads = slow • memcpy?? • thread context switches copy the stack w/ memcpy • EM allocates huge buffer on the stack • solution: move buffer to the heap
  • 37. PERFTOOLS.RB perftools for ruby code pprof.rb /tmp/myrbprof github.com/tmm1/perftools.rb
  • 38. gem install perftools.rb RUBYOPT="-r`gem which perftools | tail -1`" CPUPROFILE=/tmp/myrbprof ruby myapp.rb pprof.rb /tmp/myrbprof --text pprof.rb /tmp/myrbprof --gif > /tmp/myrbprof.gif
  • 39. require 'sinatra' $ ab -c 1 -n 50 http://127.0.0.1:4567/compute $ ab -c 1 -n 50 http://127.0.0.1:4567/sleep get '/sleep' do sleep 0.25 'done' • Sampling profiler: end • 232 samples total get '/compute' do • 83 samples were in /compute proc{ |n| a,b=0,1 • 118 samples had /compute on the stack but were in n.times{ a,b = b,a+b } another function b }.call(10_000) • /compute accounts for 50% 'done' of process, but only 35% of time was in /compute itself end == Sinatra has ended his set (crowd applauds) PROFILE: interrupts/evictions/bytes = 232/0/2152 Total: 232 samples 83 35.8% 35.8% 118 50.9% Sinatra::Application#GET /compute 56 24.1% 59.9% 56 24.1% garbage_collector 35 15.1% 75.0% 113 48.7% Integer#times
  • 40. CPUPROFILE_REALTIME=1 CPUPROFILE=app.prof CPUPROFILE=app-rt.prof
  • 43. faster bundle install • 23% spent in Gem::Version#<=> • simple patch to rubygems improved overall install performance by 15% • http://gist.github.com/ 458185
  • 44. CPUPROFILE_OBJECTS=1 CPUPROFILE=app-objs.prof • object allocation profiler mode built-in • 1 sample = 1 object created • Time parsing is both CPU and object allocation intensive • using mysql2 moves this to C
  • 45. LTRACE trace library calls ltrace -cp <pid> ltrace -ttTp <pid> -o <file>
  • 46. ltrace -c ruby threaded_em.rb % time seconds usecs/call calls function ------ ----------- ----------- --------- -------------------- 48.65 11.741295 617 19009 memcpy 30.16 7.279634 831 8751 longjmp 9.78 2.359889 135 17357 _setjmp 8.91 2.150565 285 7540 malloc 1.10 0.265946 20 13021 memset 0.81 0.195272 19 10105 __ctype_b_loc 0.35 0.084575 19 4361 strcmp 0.19 0.046163 19 2377 strlen 0.03 0.006272 23 265 realloc ------ ----------- ----------- --------- -------------------- 100.00 24.134999 82999 total ltrace -ttT -e memcpy ruby threaded_em.rb 01:24:48.769408 --- SIGVTALRM (Virtual timer expired) --- 01:24:48.769616 memcpy(0x1216000, "", 1086328) = 0x1216000 <0.000578> 01:24:48.770555 memcpy(0x6e32670, "240&343v", 1086328) = 0x6e32670 <0.000418> 01:24:49.899414 --- SIGVTALRM (Virtual timer expired) --- 01:24:49.899490 memcpy(0x1320000, "", 1082584) = 0x1320000 <0.000628> 01:24:49.900474 memcpy(0x6e32670, "", 1086328) = 0x6e32670 <0.000479>
  • 47. LTRACE/LIBDL trace dlopen’d library calls ltrace -F <conf> -bg -x <symbol> -p <pid> github.com/ice799/ltrace/tree/libdl
  • 48. ltrace -F <conf> -b -g -x <sym> -b Ignore signals. -g Ignore libraries linked at compile time. -F <conf> Read prototypes from config file. -x <sym> Trace calls to the function sym. -F ltrace.conf int mysql_real_query(addr,string,ulong); void garbage_collect(void); int memcached_set(addr,string,ulong,string,ulong);
  • 49. ltrace -x garbage_collect 19:08:06.436926 garbage_collect() = <void> <0.221679> 19:08:15.329311 garbage_collect() = <void> <0.187546> 19:08:17.662149 garbage_collect() = <void> <0.199200> 19:08:20.486655 garbage_collect() = <void> <0.205864> 19:08:25.102302 garbage_collect() = <void> <0.214295> 19:08:35.552337 garbage_collect() = <void> <0.189172>
  • 50. ltrace -x mysql_real_query mysql_real_query(0x1c9e0500, "SET NAMES 'UTF8'", 16) = 0 <0.000324> mysql_real_query(0x1c9e0500, "SET SQL_AUTO_IS_NULL=0", 22) = 0 <0.000322> mysql_real_query(0x19c7a500, "SELECT * FROM `users`", 21) = 0 <1.206506> mysql_real_query(0x1c9e0500, "COMMIT", 6) = 0 <0.000181>
  • 51. ltrace -x memcached_set memcached_set(0x15d46b80, "Status:33", 21, "004b", 366) = 0 <0.01116> memcached_set(0x15d46b80, "Status:96", 21, "004b", 333) = 0 <0.00224> memcached_set(0x15d46b80, "Status:57", 21, "004b", 298) = 0 <0.01850> memcached_set(0x15d46b80, "Status:10", 21, "004b", 302) = 0 <0.00530> memcached_set(0x15d46b80, "Status:67", 21, "004b", 318) = 0 <0.00291> memcached_set(0x15d46b80, "Status:02", 21, "004b", 299) = 0 <0.00658> memcached_set(0x15d46b80, "Status:34", 21, "004b", 264) = 0 <0.00243>
  • 52. GDB the GNU debugger gdb <executable> gdb attach <pid>
  • 53. Debugging Ruby Segfaults test_segv.rb:4: [BUG] Segmentation fault ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.7.0] def test #include "ruby.h" require 'segv' 4.times do VALUE Dir.chdir '/tmp' do segv() Hash.new{ segv }[0] { end VALUE array[1]; end array[1000000] = NULL; end return Qnil; } sleep 10 test() void Init_segv() { rb_define_method(rb_cObject, "segv", segv, 0); }
  • 54. 1. Attach to running process $ ps aux | grep ruby joe 23611 0.0 0.1 25424 7540 S Dec01 0:00 ruby test_segv.rb $ sudo gdb ruby 23611 Attaching to program: ruby, process 23611 0x00007fa5113c0c93 in nanosleep () from /lib/libc.so.6 (gdb) c Continuing. Program received signal SIGBUS, Bus error. segv () at segv.c:7 7 array[1000000] = NULL; 2. Use a coredump Process.setrlimit Process::RLIMIT_CORE, 300*1024*1024 $ sudo mkdir /cores $ sudo chmod 777 /cores $ sudo sysctl kernel.core_pattern=/cores/%e.core.%s.%p.%t $ sudo gdb ruby /cores/ruby.core.6.23611.1259781224
  • 55. def test require 'segv' 4.times do Dir.chdir '/tmp' do Hash.new{ segv }[0] end end (gdb) where end #0 segv () at segv.c:7 #1 0x000000000041f2be in call_cfunc () at eval.c:5727 test() ... #13 0x000000000043ba8c in rb_hash_default () at hash.c:521 ... #19 0x000000000043b92a in rb_hash_aref () at hash.c:429 ... #26 0x00000000004bb7bc in chdir_yield () at dir.c:728 #27 0x000000000041d8d7 in rb_ensure () at eval.c:5528 #28 0x00000000004bb93a in dir_s_chdir () at dir.c:816 ... #35 0x000000000041c444 in rb_yield () at eval.c:5142 #36 0x0000000000450690 in int_dotimes () at numeric.c:2834 ... #48 0x0000000000412a90 in ruby_run () at eval.c:1678 #49 0x000000000041014e in main () at main.c:48
  • 56. GDB.RB gdb with MRI hooks gem install gdb.rb gdb.rb <pid> github.com/tmm1/gdb.rb
  • 57. (gdb) ruby eval 1+2 3 (gdb) ruby eval Thread.current #<Thread:0x1d630 run> (gdb) ruby eval Thread.list.size 8
  • 58. (gdb) ruby threads list 0x15890 main thread THREAD_STOPPED WAIT_JOIN(0x19ef4) 0x19ef4 thread THREAD_STOPPED WAIT_TIME(57.10s) 0x19e34 thread THREAD_STOPPED WAIT_FD(5) 0x19dc4 thread THREAD_STOPPED WAIT_NONE 0x19dc8 thread THREAD_STOPPED WAIT_NONE 0x19dcc thread THREAD_STOPPED WAIT_NONE 0x22668 thread THREAD_STOPPED WAIT_NONE 0x1d630 curr thread THREAD_RUNNABLE WAIT_NONE
  • 59. (gdb) ruby objects HEAPS 8 SLOTS 1686252 LIVE 893327 (52.98%) FREE 792925 (47.02%) scope 1641 (0.18%) regexp 2255 (0.25%) data 3539 (0.40%) class 3680 (0.41%) hash 6196 (0.69%) object 8785 (0.98%) array 13850 (1.55%) string 105350 (11.79%) node 742346 (83.10%)
  • 60. (gdb) ruby objects strings 140 u'lib' 158 u'0' 294 u'n' 619 u'' 30503 unique strings 3187435 bytes
  • 61. def test require 'segv' 4.times do Dir.chdir '/tmp' do Hash.new{ segv }[0] end end end (gdb) ruby threads test() 0xa3e000 main curr thread THREAD_RUNNABLE WAIT_NONE node_vcall segv in test_segv.rb:5 node_call test in test_segv.rb:5 node_call call in test_segv.rb:5 node_call default in test_segv.rb:5 node_call [] in test_segv.rb:5 node_call test in test_segv.rb:4 node_call chdir in test_segv.rb:4 node_call test in test_segv.rb:3 node_call times in test_segv.rb:3 node_vcall test in test_segv.rb:9
  • 62. rails_warden leak (gdb) ruby objects classes 1197 MIME::Type 2657 NewRelic::MetricSpec 2719 TZInfo::TimezoneTransitionInfo 4124 Warden::Manager 4124 MethodOverrideForAll 4124 AccountMiddleware 4124 Rack::Cookies 4125 ActiveRecord::ConnectionAdapters::ConnectionManagement 4125 ActionController::Session::CookieStore 4125 ActionController::Failsafe 4125 ActionController::ParamsParser 4125 Rack::Lock 4125 ActionController::Dispatcher 4125 ActiveRecord::QueryCache 4125 ActiveSupport::MessageVerifier 4125 Rack::Head middleware chain leaking per request
  • 63. mongrel sleeper thread 0x16814c00 thread THREAD_STOPPED WAIT_TIME(0.47) 1522 bytes node_fcall sleep in lib/mongrel/configurator.rb:285 node_fcall run in lib/mongrel/configurator.rb:285 node_fcall loop in lib/mongrel/configurator.rb:285 node_call run in lib/mongrel/configurator.rb:285 node_call initialize in lib/mongrel/configurator.rb:285 node_call new in lib/mongrel/configurator.rb:285 node_call run in bin/mongrel_rails:128 node_call run in lib/mongrel/command.rb:212 node_call run in bin/mongrel_rails:281 node_fcall (unknown) in bin/mongrel_rails:19 def run @listeners.each {|name,s| s.run } $mongrel_sleeper_thread = Thread.new { loop { sleep 1 } } end
  • 64. god memory leaks (gdb) ruby objects arrays 43 God::Process elements instances 43 God::Watch 94310 3 43 God::Driver 94311 3 43 God::DriverEventQueue 94314 2 43 God::Conditions::MemoryUsage 94316 1 43 God::Conditions::ProcessRunning 43 God::Behaviors::CleanPidFile 5369 arrays 45 Process::Status 2863364 member elements 86 God::Metric 327 God::System::SlashProcPoller many arrays with 327 God::System::Process 90k+ elements! 406 God::DriverEvent 5 separate god leaks fixed by Eric Lindvall with the help of gdb.rb!
  • 65. BLEAK_HOUSE ruby memory leak detector ruby-bleak-house myapp.rb bleak /tmp/bleak.<PID>.*.dump github.com/fauna/bleak_house
  • 66. • BleakHouse • installs a patched version of ruby: ruby-bleak- house • unlike gdb.rb, see where objects were created (file:line) • create multiple dumps over time with `kill -USR2 <pid>` and compare to find leaks 191691 total objects Final heap size 191691 filled, 220961 free Displaying top 20 most common line/class pairs 89513 __null__:__null__:__node__ 41438 __null__:__null__:String 2348 ruby/site_ruby/1.8/rubygems/specification.rb:557:Array 1508 ruby/gems/1.8/specifications/gettext-1.9.gemspec:14:String 1021 ruby/gems/1.8/specifications/heel-0.2.0.gemspec:14:String 951 ruby/site_ruby/1.8/rubygems/version.rb:111:String 935 ruby/site_ruby/1.8/rubygems/specification.rb:557:String 834 ruby/site_ruby/1.8/rubygems/version.rb:146:Array
  • 67. IOPROFILE summarizes strace and lsof wget http://aspersa.googlecode.com/svn/trunk/ioprofile
  • 68. strace -cp <pid> ioprofile is a script that captures one sample of lsof output then starts strace for a specified amount of time. after strace finishes, the results are processed. below is an example that comes with ioprofile $ ioprofile t/samples/ioprofile-001.txt total pread read pwrite write filename 10.094264 10.094264 0.000000 0.000000 0.000000 /data/data/abd_2dia/aia_227_228.ibd 8.356632 8.356632 0.000000 0.000000 0.000000 /data/data/abd_2dia/aia_227_223.ibd 0.048850 0.046989 0.000000 0.001861 0.000000 /data/data/abd/aia_instances.ibd 0.035016 0.031001 0.000000 0.004015 0.000000 /data/data/abd/vo_difuus.ibd 0.013360 0.000000 0.001723 0.000000 0.011637 /var/log/mysql/mysql-relay.002113 0.008676 0.000000 0.000000 0.000000 0.008676 /data/data/master.info 0.002060 0.000000 0.000000 0.002060 0.000000 /data/data/ibdata1 0.001490 0.000000 0.000000 0.001490 0.000000 /data/data/ib_logfile1 0.000555 0.000000 0.000000 0.000000 0.000555 /var/log/mysql/mysql-relay-log.info 0.000141 0.000000 0.000000 0.000141 0.000000 /data/data/ib_logfile0 0.000100 0.000000 0.000000 0.000100 0.000000 /data/data/abd/9fvus.ibd
  • 69. strace -ttTp <pid> -o <file> -c CELL specify what to put in the cells of the output. ‘times’, ‘count’, or ‘sizes‘. below is an example of -c sizes: $ ioprofile -c sizes t/samples/ioprofile-001.txt total pread read pwrite write filename 90800128 90800128 0 0 0 /data/data/abd_2dia/aia_227_223.ibd 52150272 52150272 0 0 0 /data/data/abd_2dia/aia_227_228.ibd 999424 0 0 999424 0 /data/data/ibdata1 638976 131072 0 507904 0 /data/data/abd/vo_difuus.ibd 327680 114688 0 212992 0 /data/data/abd/aia_instances.ibd 305263 0 149662 0 155601 /var/log/mysql/mysql-relay.002113 217088 0 0 217088 0 /data/data/ib_logfile1 22638 0 0 0 22638 /data/data/master.info 16384 0 0 16384 0 /data/data/abd/9fvus.ibd 1088 0 0 0 1088 /var/log/mysql/mysql-relay-log.info 512 0 0 512 0 /data/data/ib_logfile0
  • 70. /proc lots of interesting things hiding in proc
  • 71. /proc/[pid]/pagemap • (as of linux 2.6.25) • /proc/[pid]/pagemap - find out which physical frame each virtual page is mapped to and swap flag. • /proc/kpagecount - stores number of times a particular physical page is mapped. • /proc/kpageflags - flags about each page (locked, slab, dirty, writeback, ...) • read more: Documentation/vm/pagemap.txt
  • 72. /proc/[pid]/stack • get a process’s stack trace
  • 73. /proc/[pid]/status • lots of small bits of information
  • 75. /proc/sys/kernel/core_pattern • tell system where to output core dumps • can also launch user program when core dumps happen. • echo "|/path/to/core_helper.rb %p %s %u %g" > /proc/sys/kernel/core_pattern • /proc/[pid]/ files are kept in place until your handler exits, so full state of the process at death may be inspected. • http://gist.github.com/587443
  • 76. and lots more /proc/meminfo /proc/scsi/* /proc/net/* /proc/sys/net/ipv4/* ...
  • 78. • how do you know when a hard drive in your RAID array fails? • turns out there some command line tools that most RAID vendors provide. • adaptec - /usr/StorMan/arcconf getconfig 1 AL • 3ware - /usr/bin/tw_cli
  • 79. snooki:/# /usr/StorMan/arcconf getconfig 1 AL Controllers found: 1 ---------------------------------------------------------------------- Controller information ---------------------------------------------------------------------- Controller Status : Optimal Channel description : SAS/SATA Controller Model : Adaptec 3405 Controller Serial Number : 7C4911519E3 Physical Slot :2 Temperature : 42 C/ 107 F (Normal) Installed memory : 128 MB Copyback : Disabled Background consistency check : Enabled Automatic Failover : Enabled Global task priority : High Stayawake period : Disabled Spinup limit internal drives :0 Spinup limit external drives :0 Defunct disk drive count :0 Logical devices/Failed/Degraded : 1/0/0 -------------------------------------------------------- Controller Version Information -------------------------------------------------------- BIOS : 5.2-0 (17304) Firmware : 5.2-0 (17304) Driver : 1.1-5 (2461)
  • 80. • write a script to parse that • run it with cron • the ugly ruby script i use for adaptec: http://gist.github.com/643666
  • 81. more well known tools: iostat, vmstat, top, and free
  • 84. CONFIG_HZ_100=y CONFIG_HZ=100 • Set the timer interrupt frequency. • Fewer timer interrupts means processes run with fewer interruptions. • Servers (without interactive software) should have lower timer frequency.
  • 86. CONFIG_CONNECTOR=y CONFIG_PROC_EVENTS=y • connector kernel module is useful for process monitoring. • build or use a system like god to watch processes. • when processes die the kernel notifies you • you can restart/recover/etc.
  • 88. sudo ethtool -K eth1 tso on • Allows kernel to offload large packet segmentation to the network adapter. • Frees the CPU to do more useful work. • After running the command above, verify with: [joe@timetobleed]% dmesg | tail -1 [892528.450378] 0000:04:00.1: eth1: TSO is Enabled
  • 89. http://kerneltrap.org/node/397 Tx/Rx TCP file send long (bi-directional Rx/Tx): w/o TSO: 1500Mbps, 82% CPU w/ TSO: 1633Mbps, 75% CPU Tx TCP file send long (Tx only): w/o TSO: 940Mbps, 40% CPU w/ TSO: 940Mbps, 19% CPU
  • 90. INTEL I/OAT DMA ENGINE
  • 91. CONFIG_DMADEVICES=y CONFIG_INTEL_IOATDMA=y CONFIG_DMA_ENGINE=y CONFIG_NET_DMA=y • these options enable Intel I/OAT DMA engine present in recent Xeon CPUs. • increases throughput because kernel can offload network data copying to the DMA engine. • CPU can do more useful work. • statistics about savings can be found in sysfs: /sys/class/dma/
  • 92. check if I/OAT is enabled [joe@timetobleed]% dmesg | grep ioat ioatdma 0000:00:08.0: setting latency timer to 64 ioatdma 0000:00:08.0: Intel(R) I/OAT DMA Engine found, 4 channels, device version 0x12, driver version 3.64 ioatdma 0000:00:08.0: irq 56 for MSI/MSI-X
  • 94. CONFIG_DCA=y • I/OAT includes Direct Cache Access (DCA) • DCA allows a driver to warm CPU cache. • Requires driver and device support. • Intel 10GbE driver (ixgbe) supports this feature. • Must enable this feature in the BIOS. • Some vendors hide BIOS option so you will need a hack to enable DCA.
  • 95. DCA enable hack get a hack to enable DCA on some vendor locked systems: http://github.com/ice799/dca_force read about the hack here: http://timetobleed.com/enabling-bios- options-on-a-live-server-with-no-rebooting/
  • 97. insmod e1000e.ko InterruptThrottleRate=1 • SOME drivers allow you to specify the interrupt throttling algorithm. • e1000e is one of these drivers. • Two dynamic throttling algorithms: dynamic (1) and dynamic conservative (3). • The difference is the interrupt rate for “Lowest Latency” traffic. • Algorithm 1 is more aggressive for this traffic class. • Read driver documentation for more information. • Be careful to avoid receive livelock.
  • 99. Process Affinity • Linux allows you to set which CPU(s) a process may run on. • For example, set PID 123 to CPUs 4-6: # taskset -c 4,5,6 123
  • 101. IRQ Affinity • NIC, disk, etc IRQ handlers can be set to execute on specific processors. • The IRQ to CPU map can be found at: /proc/interrupts • Individual IRQs may be set in the file: /proc/irq/[IRQ NUMBER]/smp_affinity
  • 102. IRQ affinity • Can pin IRQ handlers for devices to specific CPUs. • Can then use taskset to pin important processes to other CPUs. • The result is NIC and disk will not interrupt important processes running elsewhere. • Can also help preserve CPU caches.
  • 103. irqbalance • http://www.irqbalance.org • “irqbalance is a Linux* daemon that distributes interrupts over the processors and cores you have in your computer system.”
  • 105. CONFIG_OPROFILE=y CONFIG_HAVE_OPROFILE=y • oprofile is a system wide profiler that can profile both kernel and application level code. • oprofile has a kernel driver which collects data from CPU registers (on x86 these are MSRs). • oprofile can also annote source code with performance information. • this can help you find and fix performance problems.
  • 107. CONFIG_LATENCYTOP=y • LatencyTOP helps you understand what caused the kernel to block a process.
  • 111. TOOLS
  • 112. TWEAKS
  • 113. Thanks. (spasiba ?) @joedamato timetobleed.com