Optimization of RocksDB for Redis on Flash
Keren Ouaknine
Hebrew University
Givat Ram Jerusalem
9190401 Israel
ouaknine@cs.huji.ac.il
Oran Agra
Redis Labs
Habarzel 28 Tel-Aviv
6971040 Israel
oran@redislabs.com
Zvika Guz
Samsung Semiconductor
3655 N 1st st. San Jose CA
95134 USA
zvika.guz@samsung.com
ABSTRACT
RocksDB is a popular key-value store, optimized for fast storage.
With Solid-State Drives (SSDs) becoming prevalent, RocksDB
gained widespread adoption and is now common in production set-
tings. Specifically, various software stacks embed RocksDB as a
storage engine to optimize access to block storage. Unfortunately,
tuning RocksDB is a complex task, involving many parameters
with different degrees of dependencies. As we show in this pa-
per, a highly tuned configuration can improve performance by an
order of magnitude over the baseline configuration.
In this paper, we describe our experience optimizing RocksDB for
Redis-on-Flash (RoF) – a commercial implementation of the Redis
in-memory key-value store that uses SSDs as RAM extension to
dramatically increase the effective per-node capacity. RoF stores
hot values in RAM, and utilizes RocksDB to store and manage
cold data on SSD drives. We describe our methodology for tun-
ing RocksDB parameters and present our experiments and find-
ings (including both positive and negative tuning results) on two
clouds: EC2 and GCE. Overall, we show how tuning RocksDB im-
proved the database replication time for RoF by more than 11x. We
hope that our experience will help others adopt, configure, and tune
RocksDB in order to realize its full performance potential.
CCS Concepts
•Information systems → Key-value stores; Database perfor-
mance evaluation;
Keywords
Databases, Benchmark, Redis, Rocksdb, Key-Value Store, SSD,
NVMe
1. INTRODUCTION
RocksDB is a persistent key-value (KV) store that was specifically
architected for fast storage, mainly flash-based SSDs [1]. Forked
from LevelDB [2], RocksDB provides superior performance [3],
and was designed to be highly flexible in order to facilitate embed-
ding as a storage engine by higher-level applications. Indeed, many
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full cita-
tion on the first page. Copyrights for components of this work owned by others than
ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re-
publish, to post on servers or to redistribute to lists, requires prior specific permission
and/or a fee. Request permissions from permissions@acm.org.
ICCDA ’17 May 19-23, 2017, Lakeland, FL, USA
c
2017 Association for Computing Machinery.
ACM ISBN 978-1-4503-5241-3/17/05. .. $15.00
http://dx.doi.org/10.1145/3093241.3093278
large-scale production applications use RocksDB to manage stor-
age, leveraging its high performance to mitigate the ever-growing
pressure on the storage-system [4].
Unfortunately, RocksDB flexibility and superior performance come
at a cost: tuning RocksDB is a complex task that involves more than
a hundred parameters with varying levels of inter-dependencies.
Furthermore, “while recent changes have made RocksDB better, it
is much harder to configure than LevelDB”; too often poor results
“are caused by misconfiguration” [5].
The main questions raised when operating with RocksDB are: (1)
which configuration parameters should be used for which hardware
and under what workload? (2) what are the optimal values for these
parameters? (3) are parameters interdependent (i.e., tuning param-
eter a works if and only if parameters b, c and d have certain val-
ues)? (4) will the positive optimization from two different tunings
cumulate or negate when brought together? Last but not least, (5)
what, if any, are the side effects of these optimizations?
This paper seeks to answer these questions by sharing our ex-
perience optimizing RocksDB in the context of Redis-on-Flash
(RoF) [6, 7] – a commercial extension to the popular Redis in-
memory key value store [8]. RoF uses SSDs as a RAM extension
to provide competitive performance to the in-memory Redis vari-
ant while dramatically increasing the effective dataset capacity that
can be stored on a single server. In RoF, hot values are saved in
RAM, while cold-values are saved in SSDs and are managed by
RocksDB (See Section 2.2). Because RocksDB handles all of RoF
accesses to storage, its performance plays a major role in the over-
all system performance, especially for use cases with low access
locality. Since RoF aims to provide competitive performance to
the pure-RAM Redis variant, tuning RocksDB proved to be a key
challenge.
During the process of tuning RocksDB for the RoF case, we ana-
lyzed a large set of parameters and experimented with their impact
on the performance for several different workloads – database repli-
cation, a write-only workload, and a 50-50 read:write workload.
To verify the robustness of our settings across different hardware
setups, we run all experiments in both Amazon Elastic Compute
Cloud (EC2) and Google Compute Engine (GCE). Overall, our tun-
ing reduced the time needed to replicated a node by more than 11x.
The bulk of this paper describes the methodology, tuning process,
and specific parameters settings that lead us to this result.
In Section 3, we describe our methodology and explain the experi-
ments process. Then, in Section 4 we detail the parameters tuning
that had the largest positive effect on performance. We also specif-
ically list parameters for which we expected performance improve-
ment but instead either reduced performance or had other negative