~/talk

Writing a TSDB from Scratch: Performance Optimization

Talkat GopherCon Europe 2023 · 2023-06-26..06-29· [databases]
slides:none on file

VictoriaMetrics is a Go TSDB built from scratch and sustains about 17 million samples/sec ingestion with roughly 100 RPS reads, so optimizations focus on write-heavy, CPU-bound work. Techniques include string interning backed by sync.Map to cut allocations, a caching transformer for repeated label rewrites, limiting concurrency with token channels sized to CPU cores, and a bucketed sync.Pool of 17 buffer sizes to reduce GC and avoid oversized buffers. These measures reduce memory and CPU waste and work well for predictable, repeatable metric variants.

AI-written summary · about

  1. 0:00Time series databases intro
  2. 1:04Time series data structure
  3. 3:11TSDB workload patterns
  4. 4:37TSDB system design
  5. 6:03String interning optimization
  6. 8:13Thread-safe string interning
  7. 10:43Caching function results
  8. 13:29Limiting CPU-bound concurrency
  9. 16:46Concurrency with token channels
  10. 18:14Byte buffer sync.Pool
  11. 21:02Bucketized sync.Pool
  12. 24:34Performance optimizations summary
  13. 25:18Q&A
~/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.