Faster, Faster, 150x times Faster

Vladimir Rodionov
Carrot Data Engineering Blog
3 min readSep 27, 2024
Thank you, DALL-E

This is blog post #4 in our ongoing series dedicated to our new product — Memcarrot. Memcarrot is a Memcached-compatible caching server, which means it can be seamlessly used as a drop-in replacement without requiring any client-side code changes.

What makes Memcarrot truly stand out are its several exciting features, designed to improve performance, efficiency, and ease of use compared to other caching servers. From advanced memory management to innovative compression techniques, Memcarrot offers a robust solution for modern caching needs.

If you’re new to Memcarrot, I highly recommend visiting our Engineering Blog to explore all of its features in detail and see how it can benefit your infrastructure. The topic of this post is data snapshot performance.

In this post, we’ll dive into the performance of this task and measure how Redis and Memcarrot compare in terms of speed and efficiency when taking and restoring snapshots. Let’s see which server handles this process more effectively.

Data snapshots

Both Memcarrot and Redis support data snapshots, with Memcarrot currently offering snapshots on shutdown only, while work is ongoing for real-time snapshots similar to Redis’s RDB snapshots. Data snapshots are a powerful feature that opens up new possibilities for system administrators, such as cache data backups, warm server restarts (where the cache is preloaded with data), data cloning to quickly spin up read replicas, cluster scale out, etc.

The most important aspect of data snapshots? Performance. The time it takes to create a snapshot and restore the cache from it is critical — speed matters. In this benchmark, we measure the performance of data snapshots in Memcarrot and Redis by evaluating the time taken to save, load, and restart servers using datasets from the membench repository.

In-memory dataset sizes for both Memcarrot and Redis are provided in Table 1 here. All server configurations are identical to those used in the memory and performance tests:

  • Memcarrot: compression.enabled=true, compression.level=3, compression.codec=ZSTD, save.on.shutdown=true (these are default settings)
  • Redis: Tested with default server settings, client-side compression=zlib, level=3

The test is straightforward: we load each dataset from the Membench repository (there are 10 in total) into either Memcarrot or Redis, then shut down the server and start it again. We record the dataset save and load time for each server. Memcarrot explicitly logs shutdown and startup times, while Redis logs messages with timestamps before the saving/loading process starts and after it finishes. This allows us to calculate the difference and determine both save and load times.

Membench command line:

bin/membench.sh -b dataset_name -n N -t 8 -m load -l redis -p 6379

dataset_name = {airbnb, amazon_product_reviews, arxiv, ohio, spotify, twitter, twitter_sentiments, dblp, github, reddit}

N — number of records to load. It varies between tests 10M — 100M (please refer to Membench repository for exact numbers for every datasets).

Test setup

Hardware: Mac Studio M1, 64GB RAM

OS: Mac Sonoma 14.6

Results

We measure the total of the save and load times as the server restart time.

Picture 1. Snapshot performance (in seconds) on logarithm scale.

Memcarrot outperforms Redis in snapshot operations by an astonishing 27–149x across all 10 datasets. This is why we proudly call our snapshots Ultra Fast Snapshots.

Why are they so fast? Unlike traditional methods, Memcarrot eliminates random RAM access during both save and load operations. Instead, all RAM accesses are sequential, ensuring faster processing. Additionally, we’ve optimized disk I/O to further accelerate the process.

The image accompanying this blog post perfectly captures this reality: Memcarrot is as much faster than Redis as an airplane is faster than a running man. 😄

Post #1 : Caching 1 billion tweets on laptop

Post #2: Four billion tweets challenge

Post #3: Memory Matters: Benchmarking Caching Servers with Membench

References:

  1. Memcarrot : https://www.github.com/carrotdata/memcarrot
  2. Membench : https://www.github.com/carrotdata/membench
  3. Carrot Data : https://trycarrots.io
  4. Benchmarks: https://github.com/carrotdata/memcarrot/wiki/Benchmarks
  5. Redis : https://redis.io

--

--

No responses yet