Download presentation
Presentation is loading. Please wait.
Published byArron Owens Modified over 6 years ago
1
MemC3: Compact and Concurrent MemCache with Dumber Caching and Smarter Hashing
2
MemCache Widely used for high-performance Easy to use
3
MemCache Interface Get()
4
MemCache Interface Update()
5
MemCache Two parts: hash table & LRU lists Chaining
Variable k/v objects Fixed 1MB page Multi-chunks per page Chunk size: 43 slab classes Doubly-linked list for LRU
6
MemCache Threading Perf Enhance Originally single-threaded
Global lock 4 multi-threads Perf Enhance in-mem data to diff cores Imbalanced loads
7
Problems with MemCache
Inspired by several K/V workloads P1: small object Keys < 32 bytes, values < 100~ bytes 56B header for each K/V object Needs compact P2: read heavy Mutex locks, not optimized P3: Low hash table occupancy ratio Space efficiency -> more K/V objects
8
Goals of MemC3 Memory efficiency and throughput
High hash table occupancy ratio Compact data structure Concurrency: multi-reads/single-write
9
Re-designs Hash table Cache management
10
Cuckoo Hashing Space efficiency 2 hashes Example: A, H
11
Imprmt of Cuckoo 2 buckets, 4-way Tag 1-byte Tag-based lookup
Cache-friendly
12
Imprmt of Cuckoo 2 buckets, 4-way Tag 1-byte Tag-based insert
Cache-friendly Never retrieve keys
13
Concurrent Cuckoo Obstacle1: w/w Obstacle2: r/w
deadlock risk Sol: single write Obstacle2: r/w Floating victim key Sol: execute backwards Lookup/Insert lock two buckets(*)
14
MemC3’s Cache mgmt Problems Space overhead:
18 bytes, 2 pointers and 2-byte ref counters Updates needs to be serialized Sync bottleneck
15
MemC3’s Cache mgmt CLOCK replacement Approximate LRU update(): set 1
evict(): set 0 and forward until find 0 Question: map each bit to K/V object? 1 1 1 For each slab class 1 1
16
Performance
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.