Debugging Ruby
summary
Walks through concrete Linux-first diagnostics: use strace to collect short traces and find sigprocmask 3.5M calls causing ~30% overhead; tcpdump + Wireshark to replay slow HTTP and MySQL packets and spot a 1.3s query; perf/perf-tools reveals re_match taking 12% of CPU leading to replacing a Ruby time parser with a C one; ltrace/GDB(+gdb.rb) expose thread context copies and segfault stacks so buffers move to the heap; mov shows ~4M objects allocated and GC pauses ~200ms, fixed by switching drivers or reducing allocations.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:40Estrace
- 5:32TCP Dump
- 7:34CPU Profiler
- 11:51Perf Tools
- 16:55Profiler
- 18:10LTrace
- 19:54GLTrace
- 21:57GDB
- 24:58GV
- 30:31Mint
- 32:28Macros
related talks
50mLinux loves Ruby, Ruby loves Linux
28mTracing your way through Ruby
42mDebugging Ruby
31mPeeking into Ruby: Tracing Running Code
38mFinding a needle in the haystack - Debugging performance issues
33mFixing Performance & Memory problems
24mRuby Performance Secrets and How to Uncover Them
37mWhat’s happening in your Rails app? Introduction to Introspection features of Ruby
