~/talk

Whoops! I Rewrote it in Rust

Talkat Strange Loop 2021 · 2021-09-30..10-02· [rust]
slides:none on file

Rewrites Pelikan pieces in Rust, starting with a tokio/mio networking prototype and boringssl TLS, then replaces the C storage by implementing a single‑threaded segment storage rewrite that cuts metadata to ~5 bytes per item and needs ~two months of work. Benchmarks initially show a 10–15% throughput drop and ~25–30% higher p39, but the final Rust storage matches or beats C at high load and achieves ~93% DRAM perf on Optane PMEM (4:1 R/W). Uses cargo bench and cargo fuzz.

AI-written summary · about

  1. 0:00Intro
  2. 2:11Pelikan • open source caching framework • single codebase • multiple solutions
  3. 2:43Use Rust to: • add Transport Layer Security (TLS) • match performance of Cimplementation
  4. 3:42Rust Storage in Pelikan: 2018 Engineer wants to add storage to Pelikan and write the library in Rust . Used the framework with FFI to use Rust Storage • First commit of Rust to Pelikan!
  5. 4:23Rust Server in Pelikan: 2019 Engineer wants to use Rust for server code • Tokio / async server • Reuse components for Storage / Parser/Buffers/Metrics
  6. 5:16Performance Testing Apply synthetic workloads with ratelimit to measure latency at a specific requestrate
  7. 7:54Performance Problems . Throughput 10-15% slower a need more instances to match throughput requirements . Latency 25-30% higher l@p999/99.9th Percentile
  8. 13:13Prototype • Memcached protocol compatible • wrapped std::collections::HashMap as temporary storage • benchmarking looked good • next step: FFI for storage library
  9. 16:36Whoops! All Rust • Implemented new research storage design
  10. 19:53Rust Tooling Benefits • cargo bench & criterion o microbenchmarking of critical components
  11. 24:45Sorting by TTL • Enables efficient eager expiration no need to expire on read • New eviction strategies o closest to expiration
  12. 28:31PMEM Support • Intel Optane Persistent Memory IPMEMI • Metadata in DRAM
  13. 30:02Next Steps Path to Production • feature complete • more testing • production canary • deployment
  14. 31:01Rewriting: Costs and Benefits Costs • Extra time would have caused missed deadlines • Duplicating work that's been paid for
  15. 31:36Cand Rust are both very fast Profiling and benchmarking helped get us match the performance of the implementation
  16. 32:45Pelikan has an exciting future with Rust!
~/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.