Whoops! I Rewrote it in Rust

Whoops! I Rewrote it in Rust

Strange Loop Conference via YouTube Direct link

Intro

1 of 16

1 of 16

Intro

Class Central Classrooms beta

YouTube playlists curated by Class Central.

Classroom Contents

Whoops! I Rewrote it in Rust

Automatically move to the next video in the Classroom when playback concludes

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

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.