Whoops! I Rewrote It in Rust
summary
Three engineers incrementally add Rust to Pelikan, producing a Twimcache prototype and then a segcache rewrite that aims to replace Memcached/Redis forks. Early Rust server using tokio and a C storage layer shows 10–15% throughput loss and 25–30% higher p39 latency, prompting a mio-based ping server and a storage rewrite. Final segcache uses BoringSSL and tokio and benchmarking with cargo bench and cargo fuzz and matches or beats single-threaded memcache but still trails in multi-threaded runs.
AI-written summary · about
chapters (12)
- 0:00Intro
- 2:05Use Rust to: . ack Transport Layer Security (TLS) • match performance of implementation
- 2:45Rust 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!
- 3:12Rust Server in Pelikan: 2019 Engineer wants to use Rust for server code
- 3:47Performance Testing Apply synthetic workloads with ratelimit to measure latency at a specific request rate
- 6:36Performance Problems Throughput 10-15% slower
- 10:48Prototype • Memcached protocol compatible • wrapped std::collections:: HashMapas temporary storage benchmarking looked good • next step: FFI for storage library
- 15:53Rewrite Benefits new storage design • added new ideas to storage library helped make it more production ready
- 17:15'empowering everyone to build reliable and efficient software • high performance • code with confidence in reliability awesome language features and tools zero cost abstraction
- 19:10microbenchmarking of critical components cargo fuzz easy to add fuzz testing for protocol library
- 22:42Next Steps Path to Production • feature complete . more testing • production canary • deployment
- 25:03Rewriting has costs and benefits Costs • Extra time would have • Easier to work with an all caused missed deadlines Rust codebase Duplicating work that's • No more cmake!!! been paid for
related talks
34mWhoops! I Rewrote it in Rust
33mRewrite, Optimize, Repeat
42mRewrite It In Rust: Can We RIIR Everything?
30mRewrite, optimize, repeat: Our journey porting a triemap from C to Rust
33mRust at Sentry: 7 Years Later
46mAdopting Rust by gracefully oxidising web applications
38mLess Tokio is More Tokio: Strategies for Accelerating a Rust Native Search Database
40mRust’s approach of getting things right
