384 13th USENIX Conference on File and Storage Technologies (FAST ’15) USENIX Association
7 Related Work
To the best of our knowledge, no prior work provides
a flexible framework for efficiently implementing ad-
vanced caching algorithms on flash. Yet, there is a large
body of related work in several heavily-researched fields.
Flash-based Caching Solutions Flash devices have
been applied in various caching solutions for their large
capacities and high I/O performance [2, 4, 21, 23, 27,
31, 35, 37, 39, 42, 46]. To avoid their poor handling
of small random write workloads, previous studies ei-
ther use sequential eviction akin to FIFO [2], or only
perform coarse-grained caching policies at the unit of
large blocks [21, 31, 46]. Similarly, SIPQ and RIPQ
also achieve high write throughputs and low device
overheads on flash through sequential writes and large
aligned writes, respectively. In addition, they allow
efficient implementations of advanced caching policies
at a fine-grained object unit, and our experience show
that photo caches built on top of RIPQ and SIPQ yield
significant performance gains at Facebook. While our
work mainly focuses on the support of eviction part of
caching operations, techniques like selective insertions
on misses [21, 46] are orthogonal to RIPQ and can be
applied to further reduce the data written to flash.
7
RAM-based Advanced Caching Caching has been an
important research topic since the early days of com-
puter science and many algorithms have been proposed
to better capture the characteristics of different work-
loads. Some well-known features include recency (LRU,
MRU [13]), frequency (LFU [33]), inter-reference time
(LIRS [24]), and size (SIZE [1]). There have also been
a plethora of more advanced algorithms that consider
multiple features, such as Multi-Queue [48] and Seg-
mented LRU (SLRU) [26] for both recency and fre-
quency, Greedy-Dual [47] and its variants like Greedy-
Dual-Size [10] and Greedy-Dual-Size-Frequency [12]
(GDSF) using a more general method to compose the
expected miss penalty and minimize it.
While more advanced algorithms can potentially yield
significant performance improvements, such as SLRU
and GDSF for Facebook photo workload, a gap still re-
mains for efficient implementations on top of flash de-
vices because most algorithms are hardware-agnostic:
they implicitly assume data can be moved and overwrit-
ten with little overhead. Such assumptions do not hold
on flash due to its asymmetric performance for reads and
writes and the performance deterioration caused by its
internal garbage collection.
Our work, RIPQ and SIPQ, bridges this gap. They
provide a priority queue interface to allow easy imple-
7
We tried such techniques on our traces, but found the hit ratio
dropped because of the long-tail accesses for social network photos.
mentation of many advanced caching algorithms, provid-
ing similar caching performance while generating flash-
friendly workloads.
Flash-based Store Many flash-based storage systems,
especially key-value stores have been recently pro-
posed to work efficiently on flash hardware. Systems
such as FAWN-KV [6], SILT [32], LevelDB [16], and
RocksDB [14] group write operations from an upper
layer and only flush to the device using sequential writes.
However, they are designed for read-heavy workloads
and other performance/application metrics such as mem-
ory footprints and range-query efficiencies. As a result,
these systems make trade-offs such as conducting on-
flash data sorting and merges, that yield high device over-
head for write-heavy workloads. We have experimented
with using RocksDB as an on-flash photo store for our
application, but found it to have excessively high write
amplification (~5 even when we allocated 50% of the
flash space to garbage collection). In contrast, RIPQ and
SIPQ are specifically optimized for a (random) write-
heavy workload and only support caching-required in-
terfaces, and as a result have low write amplification.
Studies on Flash Performance and Interface While
flash hardware itself is also an important topic, works
that study the application perceived performance and in-
terface are more related to our work. For instance, previ-
ous research [8, 25, 36, 43] that reports the random write
performance deterioration on flash helps verify our ob-
servations in the flash performance study.
Systematic approaches to mitigate this specific prob-
lem have also been previously proposed at different lev-
els, such as separating the treatment of cold and hot data
in the FTL by LAST [29], and the similar technique in
filesystem by SFS [36]. These approaches work well for
skewed write workloads where only a small subset of the
data is hot and updated often, and thus can be grouped
together for garbage collection with lower overhead. In
RIPQ, cached contents are explicitly tagged with prior-
ity values that indicate their hotness, and are co-located
within the same device block if their priority values are
close. In a sense, such priorities provide a prior for iden-
tifying content hotness.
While RIPQ (and SIPQ) runs on unmodified com-
mercial flash hardware, recent studies [31, 41] which
co-design flash software/hardware could further benefit
RIPQ by reducing its memory consumption.
Priority Queue Both RIPQ and SIPQ rely on the pri-
ority queue abstract data type and the design of priority
queues with different performance characteristics have
been a classic topic in theoretical computer science as
well [11, 15, 18]. Instead of building an exact priority
queue, RIPQ uses an approximation to trade algorithm
fidelity for flash-aware optimization.