This repository contains the artifact for the ATC’22 paper: “Pacman: An Efficient Compaction Approach for Log-Structured Key-Value Store on Persistent Memory”.

For ATC’22 Artifact Evaluation, please check out the Artifact README from the atc22ae hotcrp system.

Directory structure

|---- benchmarks        # code of the benchmarks and other systems (Viper, ChameleonDB, PMem-RocksDB, and pmemkv)
|---- include           # public headers of pacman db
|---- db                # source code of pacman with PM-based log-structured KV store
|---- util              # utilities used for programming
|---- example           # a simple example of pacman db
|---- scripts           # main evaluation scripts

Functionality of code

  • include/db.h, db/db.cpp: DB interface

  • db/index/*: indexes used by DB, modified to utilize shortcut

  • db/segment.h: structure and basic functionality of log segment

  • db/log_structured.[h|cpp]: management of log segments in DB

  • db/loc_cleaner.[h|cpp]: main functionality of segment compaction

The major parts of Pacman’s techniques are enabled by macro GC_SHORTCUT (Sec 3.1), REDUCE_PM_ACCESS (Sec 3.2), BATCH_COMPACTION (Sec 3.3), and HOT_COLD_SEPARATE (Sec 3.4). Check out the source code for more details.


  • libraries

    • PMDK (libpmem & libpmemobj)
    • jemalloc
  • utilities for experiments:

    • numactl
    • cpupower

If you’re going to evaluate other systems (e.g., PMem-RocksDB, pmemkv), please install the their dependencies. You don’t need to install other systems manually since the cmake in this repository will fetch and build them automatically.

System configuration

1. set Optane DCPMM to AppDirect mode
$ sudo ipmctl create -f -goal persistentmemorytype=appdirect

2. configure PM device to fsdax mode
$ sudo ndctl create-namespace -m fsdax

3. create and mount a file system with DAX
$ sudo mkfs.ext4 -f /dev/pmem0
$ sudo mount -o dax /dev/pmem0 /mnt/pmem0

Building the benchmarks

We recommend that you use the scripts directly from the scripts directly. The scripts will build and run experiments automatically.

Quick start:

$ mkdir -p build && cd build
$ cmake --build .

This will build benchmark for FlatStore-H with Pacman. You may need to set the path to pmem (PMEM_DIR) in the include/

PMem-RocksDB and pmemkv will be downloaded and built by default. If you don’t want to evaluate with them, pass -DEVAL_OTHER_SYSTEMS=OFF to cmake.

To facilitate evaluation, we use cmake to set most configurations for both systems and benchmarks. Please check out the CMakeLists.txt for more details.

Running experiments

|----     # script of "Hello world"-sized examples
|----   # impact of capacity utilization (Sec 4.2.1)
|----          # YCSB benchmarks (Sec 4.2.2)
|----       # thread scalability (Sec 4.2.3)
|----    # different value sizes (Sec 4.2.3)
|----   # different write ratios (Sec 4.2.3)
|----     # different key spaces (Sec 4.2.3)
|----     # breakdown of techniques in Pacman (Sec 4.3)
|----           # Facebook ETC workload (Sec 4.4)
|----      # recovery test (Sec 4.5)
|----          # for evaluating other cases with customized configurations


  • and Execute directly with no arguments.

  • Usage for other scripts is:

    $ ./ <db_type> # for and
    $ ./ <db_type> <apply_pacman> # for the others

    Please check out the help information at the top of the scripts for details.

These scripts should be run inside the scripts directory. Each experiment will be run for several minutes. Evaluation on PMem-RocksDB and pmemkv will take much longer (PMem-RocksDB takes about 20 minutes on the Facebook ETC workload and may even abort probably).


View Github