Skip to content

Navigation Menu

Sign up

Performance Results

Chiyoung Seo edited this page Jul 22, 2014 · 12 revisions

Introduction

We evaluate the performance of ForestDB with respect to initial loading time, read and write throughput, write amplification, and so forth, and compare them with LevelDB version 1.15, and RocksDB version 3.1. For fair comparisons, we have implemented a benchmark program generating Couchbase Server’s storage APIs, and API-wrapping layers for each DB are used to convert the operations into their own operations. Note that the results shown in this page are the first round of our benchmark tests, and we will share more results in various use cases later when they become available.

Evaluation Setup

The evaluation has been performed on a 64-bit machine running Centos 6.5 (Linux 2.6.32), equipped with Intel® Xeon® E5-2620 @ 2.00 GHz CPU (6 cores, 12 threads, 15 MB L3 cache), 32 GB RAM, and Crucial M4 512GB SSD (M4-CT512M4SSD2), where the disk is formatted using the Ext4 file system.

We initialized each database instance using 100 million documents whose key size is 32 bytes and value size is approximately 1KB. The total working set size is around 90 GB, which is about 3x larger than the RAM capacity, thus the performance is mostly bounded by disk I/O.

Each database library is configured as follows (the rest of configurations are set up using their default values):

  • LevelDB
    • Snappy compression is disabled
    • Write buffer size: 256 MB (initial load), 4 MB (otherwise)
  • RocksDB
    • Snappy compression is disabled
    • Write buffer size: 256 MB (initial load), 4 MB (otherwise)
    • Maximum number of background compaction threads: 8
    • Maximum number of background memtable flushes: 8
    • Maximum number of write buffers: 8
  • ForestDB
    • Snappy compression is disabled
    • WAL size: 4,096 documents (corresponding to ~4 MB of write buffer size in LevelDB or RocksDB)
    • ForestDB’s own block cache size: 8 GB (Note that ForestDB’s block cache is not a high-level document cache, but just an alternative to the OS page cache. It caches data on a block (page) basis, thus differs from the cache structures in LevelDB or RocksDB.)

Evaluation Results

Initial Load

We first evaluate the total elapsed time and the total amount of disk writes during the initialization of each database instance using 100 million documents. Documents are inserted in a random order, where each write (put) operation is performed asynchronously in all three database instances. We do not disable compaction for both ForestDB and RocksDB. In ForestDB, we turned on ‘wal_flush_before_commit’ option, and a commit operation is called only once at the end of the initial load.

In LevelDB and RocksDB, document insertions are sequentially logged first, and then merged into SSTables. This background merge process degrades the overall throughput and latency for a long time even though the initial load is already done. We denote the elapsed time and disk writes required for the merge process after the completion of the initial load as red bars in the graphs below. It might be arguable whether this merging overhead should be accounted in the initial load performance or not. However, a database instance should be in an ordered state with respect to its primary index key when the initial load is completed, so that it can be operational instantly to support CRUD (Create, Read, Update, Delete) operations efficiently.

The results show that ForestDB takes 106 minutes to load 100 million documents, and incurs 244 GB disk writes which is 2.7x larger than the total data size.

Total elapsed time for the initial load

Total amount of disk writes for the initial load

Read-Only Performance

We measure the read performance by varying the number of reader threads from one to eight. Each reader thread simultaneously reads documents in a random order, and we compute the total operations per second. The read performance of ForestDB is scalable with the number of reader threads, but saturated at some level because it is bounded by the disk throughput. Note that the maximum 4KB read IOPS of Crucial M4 512GB SSD is 40K. Therefore, the random read throughput cannot be greater than that maximum IOPS.

Read-only performance

Write-Only Performance

In order to assess write performance, we randomly update a batch of documents using a single writer thread, varying the write batch size from 1 to 256. Every batch of updates is written into disk synchronously. For a fair comparison, we set the write buffer size of RocksDB and LevelDB to 4 MB, which almost corresponds to 4096 documents of the WAL size in ForestDB (but it is still advantageous to RocksDB because RocksDB maintains up to 8 write buffers).

The write throughput of ForestDB becomes better as the write batch size gets larger. We also measure the write amplification per document update, and ForestDB requires 7x-20x more disk writes to synchronously update a document on average. Note that the measured average write amplifications of RocksDB and LevelDB are 31x-35x and 166x-387x, respectively.

Write-only performance

Write amplification

Mixed Workload Performance (Fixed Ratio)

We evaluate the overall performance of each database instance using mixed workloads. The write batch size is fixed to 16 documents, and the ratio of write operations to the total operations is set to 20%. This means that both reader and writer threads would wait the others to strictly maintain the given Read/Write ratio.

We use a single writer thread, and change the number of reader threads from one to eight. All operations are occurred in a random order, where every write batch operation is performed synchronously.

Performance with bounded mixed load

Mixed Workload Performance (Unrestricted Ratio)

Finally, we evaluate the performance under the mixed load again, but the Read/Write ratio is not restricted at this time. As in the previous evaluation, we use a single writer thread and multiple reader threads. All reader and writer threads continuously read or write documents in their maximum capacity. All operations are occurred in a random order, and each write batch operation is performed synchronously. Note that the write batch size is fixed to 256 documents in this evaluation.

Performance with unbounded mixed load

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /