~/talk

Disk is fast, memory is slow. Forget all you think you know

Talkat RubyConfBY 2020 Online · 2020-07-18..07-19· [ruby]
links:none on file
slides:none on file

Goal is to aggregate Prometheus counters across multiple Ruby processes while keeping increments extremely cheap, with a target of 1 microsecond per increment. Experiments: PStore (serialize whole hash — unusably slow), Redis (localhost roundtrip ~60μs), mmap via a C gem (about 6 microseconds but unstable, causing mmap segfaults), and simple file writes (seek + write 8 bytes ≈ 9 microseconds). Chosen solution: plain file-backed bytes—slower than mmap but robust, C-free, JRuby-compatible, and fast enough for the use case.

AI-written summary · about

  1. 0:00Introduction and context
  2. 3:27Prometheus metrics in Ruby
  3. 10:25Fast and slow are relative
  4. 18:08Experiments with memory maps
  5. 22:01Disk is fast in this context
  6. 24:28Question assumptions and measure
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.