facebook / CacheLib

Pluggable in-process caching engine to build and scale high performance services
https://www.cachelib.org
Apache License 2.0
1.18k stars 254 forks source link

Add the support for Zoned Namespace SSD (ZNS) over NVMe into CacheLib. #280

Closed lan1gao closed 8 months ago

lan1gao commented 9 months ago

This PR adds the support for CacheLib working on ZNS SSD. With the chnages, the CacheLib is able to reduce the device-side write amplification (WA) and TCO in hybrid storage cache (DRAM and NVMe SSD).

For BlockCache object, the LOC region is configured to be aligned with the zone size, when the region is evicted, the zone is reclaimed (explicit reset command) as well, there is no valid data movement by GC. To enhance the performance, the PR also implements data striping approach. Multipe zones are grouped as a region and the data are striped into multiple slices then write into zones.

For BigHash, set is configured to align with ZNS SSD page size (e.g. 4KB). When the zone is filled with set, allocate a new zone to store sets. While all sets are evicted, the zone is reclaimed fore reuse.

The PR introduces a new class ZNSDevice in device layer to support ZNS SSD with regular block interface semantics.

ops Conventional SSD ZNS SSD
get 479,400/s 479,970/s
set 61,857/s 61,930/s
del 2,997/s 3,001/s