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