Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Whoops! I Rewrote it in Rust

Strange Loop Conference via YouTube

Overview

This course aims to teach learners how to rewrite an open-source caching framework called Pelikan in Rust, focusing on adding Transport Layer Security (TLS) and matching the performance of the original C implementation. The course covers using Rust for storage and server code, utilizing components like Tokio for asynchronous servers, and conducting performance testing to measure latency and throughput. The intended audience for this course is software engineers interested in high-performance software, systems tuning, monitoring, benchmarking, and Rust programming. The teaching method includes practical examples, performance testing, and discussions on the benefits and costs of rewriting code in Rust.

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

Reviews

Start your review of Whoops! I Rewrote it in 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.