Skip to main content
Swytch Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Benchmarks

Swytch is designed for production workloads where performance and durability both matter. This page presents benchmark results comparing Swytch to Redis under various conditions.

Test Environment

All benchmarks were run on:

  • CPU: AMD Ryzen 5 3600 (6 cores / 12 threads)
  • RAM: 64GB DDR4
  • Storage: Samsung NVMe in RAID0
  • OS: Ubuntu 24.04
  • Connection: Unix socket (lowest latency)

Where Does the Speed Come From?

Swytch’s performance advantage comes from a lock-free architecture designed from the ground up for multi-core systems:

  • Lock-free transactional index: Concurrent reads and writes proceed without blocking each other. No thread waits for another to release a lock.

  • Novel eviction algorithm: A self-tuning, lock-free eviction system that adapts to your workload in real-time. This is an area of active research—expect further improvements as we refine the algorithm.

  • FASTER-inspired storage: The persistent storage layer uses techniques from Microsoft’s FASTER research project, enabling lock-free append-only writes with indexed lookups that don’t block the hot path.

Redis processes commands single-threaded. Swytch processes commands in parallel across all available cores while maintaining the same consistency guarantees. The result: linear scaling with core count instead of a single-threaded bottleneck.

Synthetic Benchmarks

redis-benchmark (Single Operations)

Using redis-benchmark with default settings, four threads, Unix socket:

CommandSwytchRedisRatio
SET166,334 ops/s68,937 ops/s2.4x
GET166,444 ops/s74,041 ops/s2.2x
INCR166,389 ops/s68,259 ops/s2.4x
LPUSH166,500 ops/s68,927 ops/s2.4x
LPOP166,334 ops/s69,541 ops/s2.4x
LRANGE_100110,987 ops/s54,024 ops/s2.1x
LRANGE_60041,569 ops/s24,654 ops/s1.7x
MSET (10 keys)99,920 ops/s55,500 ops/s1.8x

Swytch achieves 2x+ throughput while providing full per-operation durability. Redis was configured with appendfsync everysec (1 second of potential data loss).

memtier_benchmark (Realistic Workloads)

Using memtier_benchmark with 4 threads, 50 clients, 256-byte values:

WorkloadSwytchRedisRatio
Mixed R/W (1:10)150,312 ops/s71,044 ops/s2.1x
Zipf 0.99165,403 ops/s74,150 ops/s2.2x
Zipf 1.1 + pipeline901,698 ops/s495,585 ops/s1.8x

Latency comparison (Zipf 0.99 workload):

PercentileSwytchRedis
p500.52ms0.65ms
p993.36ms5.15ms
p99.96.50ms12.8ms

High-Throughput Pipeline Test

Using redis-benchmark -c 200 -P 32 (aggressive pipelining):

SystemSET ops/sSET p50GET ops/sGET p50
Swytch (persistent)282,2079.78ms1,368,9252.37ms
Swytch (in-memory)1,308,9012.49ms1,375,5162.35ms
Redis920,8106.30ms1,213,5924.58ms
Dragonfly828,5006.43ms1,047,6693.99ms

Swytch’s in-memory mode achieves 42% higher write throughput than Redis and 58% higher than Dragonfly. Even in persistent mode with full durability, Swytch GETs remain fastest.

Large Value Performance

Production workloads often involve values larger than the 64–256 byte defaults used in most benchmarks. Here’s what happens with 400KB values—closer to real-world JSON documents, serialized objects, or cached API responses:

Test: memtier_benchmark with 4 threads, 50 clients, 400KB values, Zipf 0.99, 10:1 read:write ratio

MetricSwytchRedis
GET p502.5ms12.9ms
GET p9950.7ms97.8ms
SET p5029.4ms37.9ms
Overall throughput7,346 ops/s8,339 ops/s

Key finding: Swytch read latency is 5x better than Redis with large values.

Redis’s single-threaded architecture blocks reads during large value eviction. Every 400KB eviction stalls the entire server. Swytch’s multithreaded design isolates eviction from the read path—reads stay fast while eviction happens in the background.

For read-heavy workloads (typical for caches), this translates to dramatically better user-facing latency.

Production Trace Replay

We replayed production cache traces from published academic datasets to measure real-world hit rates and throughput.

Alibaba Block Storage Trace

256MB cache, realistic value sizes:

MetricSwytchRedis
Hit Rate98.96%75.94%
Misses9,192213,226
Throughput1,194 ops/s596 ops/s
Avg Latency83.7ms167.7ms

23 percentage points higher hit rate means 95.7% fewer backend database requests.

Twitter Cache Trace (Realistic Value Sizes)

20GB cache, value sizes scaled to production dimensions:

MetricSwytchRedis
Hit Rate96.51%96.49%
Throughput70,568 ops/s39,671 ops/s
Avg Latency1.4ms2.5ms

With realistic value sizes, hit rates are tied while Swytch delivers 1.8x throughput.

Note: Earlier benchmarks with artificially small (<1 kb) values showed Redis with a slight hit rate advantage. This disappeared when value sizes matched production conditions.

Oracle MSR Trace

8GB cache:

MetricSwytchRedis
Hit Rate~99%~99%
Throughput3x Redisbaseline

Under normal memory pressure, both systems achieve similar hit rates, but Swytch maintains 3x throughput.

Tiered Storage Performance

Swytch’s tiered storage provides full durability (10 ms max data loss) with minimal performance impact.

Test: memtier_benchmark, 4 threads, 50 clients, 256-byte values, Unix socket

Throughput

WorkloadWrite-ThroughGhost Mode
100% writes247,000 ops/s397,000 ops/s
100% reads418,000 ops/s
50/50 mixed336,000 ops/s

Latency

WorkloadModep50p99p99.9
100% writesWrite-through0.52ms3.36ms6.50ms
100% writesGhost0.43ms2.19ms5.41ms
100% readsWrite-through0.42ms1.77ms4.51ms
50/50 mixedWrite-through0.44ms2.98ms5.44ms

Write-through mode (full durability) adds minimal latency overhead. Ghost mode (write-back) offers higher write throughput when eventual persistence is acceptable.

Summary

ScenarioSwytch Advantage
Single-op throughput2-2.4x faster
Pipeline throughput1.4-1.8x faster
Large value reads5x lower latency
Production tracesSame or better hit rate, 2-3x throughput
Durability10ms vs 1000ms max data loss

Swytch delivers higher throughput, lower latency, and better durability than Redis across all tested workloads.

Reproducing These Benchmarks

redis-benchmark

# Single operations
redis-benchmark -s /path/to/socket -t set,get,incr,lpush,lpop,lrange -q --threads 4

# Pipeline stress test
redis-benchmark -s /path/to/socket -n 2000000 -c 200 -P 32 -t set,get -q

memtier_benchmark

# Realistic mixed workload
memtier_benchmark -S /path/to/socket \
  --protocol=redis \
  --threads=4 --clients=50 \
  --requests=100000 \
  --ratio=1:10 \
  --data-size=256

# Zipf distribution (hot keys)
memtier_benchmark -S /path/to/socket \
  --protocol=redis \
  --threads=4 --clients=50 \
  --requests=1000000 \
  --ratio=1:10 \
  --key-pattern=G:G \
  --key-zipf-const=0.99 \
  --key-maximum=100000 \
  --data-size=256

# Large values
memtier_benchmark -S /path/to/socket \
  --protocol=redis \
  --threads=4 --clients=50 \
  --requests=5000 \
  --ratio=1:10 \
  --key-pattern=G:G \
  --key-zipf-const=0.99 \
  --key-maximum=10000 \
  --data-size=409600