Skip to content

FalkorDB/benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

375 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cargo Build & Test License Discord Twitter

See the benchmarks (Click here)

Key Benchmark Takeaways

Navigation

Get mission-critical performance even under extreme workloads, with response times staying under 140ms at p99, while competitors struggle with multi-second latencies. Reduce infrastructure costs and improve user experience with FalkorDB's superior performance profile, requiring fewer resources to handle peak workloads.

Percentile FalkorDB (ms) Neo4j (ms) Performance Difference
p50 (median) 55.0 577.5 10.5x faster
p90 108.0 4784.1 44.3x faster
p99 136.2 46923.8 344.5x faster

About the benchmarks

This benchmark provides comprehensive performance comparisons between FalkorDB and Neo4j graph databases. This benchmark specifically focuses on aggregate expansion operations, a common workload in graph database applications. The results indicate FalkorDB's particular strength in maintaining consistent performance under varying workload conditions, especially crucial for production environments where predictable response times are essential.

System Requirements

Prerequisites

  • Ubuntu
  • Redis server
  • build-essential, cmake, m4, automake
  • libtool, autoconf, python3
  • libomp-dev, libssl-dev
  • pkg-config
  • Rust toolchain
  • SDKman
  • unzip, zip

Installation Steps

install redis server

sudo apt-get install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis
  • stop the redis server sudo systemctl stop redis-server
  • disable the redis server sudo systemctl disable redis-server
  • check the redis server status sudo systemctl status redis-server

install sdkman

  • install unzip sudo apt install unzip zip -y
  • curl -s "https://get.sdkman.io" | bash
  • load sdkman in the current shell source "$HOME/.sdkman/bin/sdkman-init.sh"

build falkordb from source

  • git clone --recurse-submodules -j8 https://github.com/FalkorDB/FalkorDB.git
  • sudo apt install build-essential cmake m4 automake libtool autoconf python3 libomp-dev libssl-dev
  • install rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • from FalkorDB root dir run make

build the benchmark from source

from ~/

  • install pkg-config sudo apt install pkg-config -y
  • git clone git@github.com:FalkorDB/benchmark.git
  • cd benchmark
  • sdk env install
  • download and unpack neo4j ./scripts/download-neo4j.sh
  • build the benchmark cargo build --release
  • enable autocomplete source <(./target/release/benchmark generate-auto-complete bash)
  • copy the falkor shared lib to cp ~/FalkorDB/bin/linux-x64-release/src/falkordb.so .

run the benchmark

run via helper scripts

Use the wrapper scripts in scripts/ for the fastest end-to-end benchmark activation:

  • scripts/run_small_benchmark.sh
  • scripts/run_medium_benchmark.sh
  • scripts/run_large_benchmark.sh

Each script handles the full pipeline for its dataset size:

  1. clears and loads enabled vendors
  2. generates vendor-specific query files
  3. runs benchmark workloads
  4. writes results into a shared RESULTS_DIR
  5. aggregates UI-ready summaries

Quick start:

./scripts/run_small_benchmark.sh
./scripts/run_medium_benchmark.sh
./scripts/run_large_benchmark.sh

Run only Falkor primary + secondary comparison:

RUN_FALKOR=1 RUN_FALKOR_2=1 RUN_NEO4J=0 RUN_MEMGRAPH=0 ./scripts/run_medium_benchmark.sh

Override workload shape:

QUERIES_COUNT=25000 WRITE_RATIO=0.05 PARALLEL=10 MPS=3000 ./scripts/run_medium_benchmark.sh

Point wrappers to external endpoints:

FALKOR_ENDPOINT=falkor://127.0.0.1:6379 \
FALKOR_ENDPOINT_2=falkor://127.0.0.1:6800 \
NEO4J_ENDPOINT=neo4j://127.0.0.1:7687 \
MEMGRAPH_ENDPOINT=bolt://127.0.0.1:17687 \
./scripts/run_small_benchmark.sh

Common environment knobs:

  • vendor toggles: RUN_FALKOR, RUN_FALKOR_2, RUN_NEO4J, RUN_MEMGRAPH
  • workload controls: BATCH_SIZE, PARALLEL, MPS, QUERIES_COUNT, WRITE_RATIO, QUERIES_FILE
  • algorithm toggles: ENABLE_ALGO_PAGERANK, ENABLE_ALGO_MAX_FLOW, ENABLE_ALGO_MSF, ENABLE_ALGO_HARMONIC
  • output folder: RESULTS_DIR
  • Falkor timeout tuning (medium/large wrappers): FALKOR_QUERY_TIMEOUT_MS
CLI workflow
Generate the docker compose for prometheus and grafana
./generate_docker_compose.sh
Run the docker compose
docker-compose up

The benchmark is a cli tool that can be used to run the benchmarks

➜  cargo run  --bin benchmark -- --help                                                                  git:(prometheus|✚7…3
    
Usage: benchmark <COMMAND>

Commands:
  generate-auto-complete
  load                    load data into the database
  generate-queries        generate a set of queries and store them in a file to be used with the run command
  run                     run the queries generated by the GenerateQueries command against the chosen vendor
  help                    Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version
load the data
  • cargo run --release --bin benchmark -- load --vendor falkor -s small
  • cargo run --release --bin benchmark -- load --vendor neo4j -s small
  • cargo run --release --bin benchmark -- load --vendor memgraph -s small

NOTE: It is possible to use the load command with externally run vendor endpoint:

  • cargo run --release --bin benchmark -- load --vendor falkor -s small --endpoint falkor://127.0.0.1:6379
  • cargo run --release --bin benchmark -- load --vendor neo4j -s small --endpoint neo4j://neo4j:benchmark123@127.0.0.1:7687
  • cargo run --release --bin benchmark -- load --vendor memgraph -s small --endpoint bolt://127.0.0.1:7687
create a set of queries to be used with the run command

cargo run --release --bin benchmark -- generate-queries -s10000000 --dataset small --name=small-readonly --write-ratio 0.0

NOTE: preparing a smaller run of 1,000,000 queries:

cargo run --release --bin benchmark -- generate-queries -s1000000 --dataset small --name=small-readonly --write-ratio 0.0

run the benchmarks
  • cargo run --release --bin benchmark run --vendor falkor --name small-readonly -p40 --mps 4000
  • cargo run --release --bin benchmark run --vendor neo4j --name small-readonly -p40 --mps 4000
  • cargo run --release --bin benchmark run --vendor memgraph --name small-readonly -p40 --mps 4000

NOTE: It is possible to use the run command externally run vendor endpoint:

  • cargo run --release --bin benchmark run --vendor falkor --name small-readonly -p40 --mps 4000 --endpoint falkor://127.0.0.1:6379
  • cargo run --release --bin benchmark run --vendor neo4j --name small-readonly -p40 --mps 4000 --endpoint neo4j://neo4j:benchmark123@127.0.0.1:7687
  • cargo run --release --bin benchmark run --vendor memgraph --name small-readonly -p40 --mps 4000 --endpoint bolt://127.0.0.1:7687
multi-vendor runs and per-vendor comparison reports (UI)

The benchmark is designed to run the same workload against multiple vendors and then generate a pairwise comparison report.

  1. Run each vendor into the same results directory (so it contains Results-.../<vendor>/{meta.json,metrics.prom}):
  • cargo run --release --bin benchmark -- run --vendor falkor --name small-readonly -p40 --mps 4000 --results-dir Results-YYMMDD-HH:MM
  • cargo run --release --bin benchmark -- run --vendor neo4j --name small-readonly -p40 --mps 4000 --results-dir Results-YYMMDD-HH:MM
  • cargo run --release --bin benchmark -- run --vendor memgraph --name small-readonly -p40 --mps 4000 --results-dir Results-YYMMDD-HH:MM
  1. Aggregate into UI-ready JSON summaries:
  • cargo run --release --bin benchmark -- aggregate --results-dir Results-YYMMDD-HH:MM --out-dir ui/public/summaries

This produces:

  • ui/public/summaries/neo4j_vs_falkordb.json
  • ui/public/summaries/memgraph_vs_falkordb.json

AWS instance comparisons (e.g. Graviton vs Intel for FalkorDB runs stored under aws-tests/):

  • cargo run --release --bin benchmark -- aggregate-aws-tests --aws-tests-dir aws-tests --out-path ui/public/summaries/aws_tests_falkor_graviton_vs_intel.json
  1. Open the UI:
  • cd ui && npm install && npm run dev

The comparison pages load only the relevant vendor pair:

  • /neo4j compares Neo4j vs FalkorDB
  • /memgraph compares Memgraph vs FalkorDB
per-query latency tracking (for the "single" view)

Workloads generated by generate-queries embed a stable q_id and a query catalog (mapping id -> query name). During run, the benchmark exports per-query latency percentiles (P10..P99) into metrics.prom and the aggregator emits them under result.histogram_for_type.

Important: if you change the query set/metrics, regenerate the workload file before running:

  • cargo run --release --bin benchmark -- generate-queries --dataset small -s1000000 --name small-readonly --write-ratio 0.0
helper script

For convenience wrappers that load data, regenerate queries, run workloads, and aggregate UI summaries, see:

  • scripts/run_small_benchmark.sh
  • scripts/run_medium_benchmark.sh
  • scripts/run_large_benchmark.sh
query explanations and samples

For the maintained query catalog guide (including phase-1 additions and sample Cypher), see:

  • QUERY_EXPLANATIONS_AND_SAMPLES.md
run simulation to see that the benchmark itself can sustain specific mps given a fixed latency on that hardware

For example, simulate 40 clients that send at 5000 messages per seconds with latency of one millisecond per call.

  • cargo run --release --bin benchmark run --vendor falkor --name small -p40 --mps 5000 --simulate 1

Data

The data is based on https://www.kaggle.com/datasets/wolfram77/graphs-snap-soc-pokec licensed: https://creativecommons.org/licenses/by/4.0/

FAQ

System Requirements

Q: What are the minimum system requirements?
A: FalkorDB requires a Linux/Unix system with 4GB RAM minimum. For production environments, 16GB RAM is recommended.

Installation & Setup

Q: Can I run FalkorDB without Redis?
A: No, FalkorDB requires Redis 6.2 or higher as it operates as a Redis module.

Development

Q: Which query language does FalkorDB use?
A: FalkorDB uses the Cypher query language, similar to Neo4j, making migration straightforward.

Data Management

Q: Does FalkorDB support data persistence?
A: Yes, through Redis persistence mechanisms (RDB/AOF). Additional persistence options are in development.

Integration

Q: Does FalkorDB support common programming languages?
A: Yes, through FalkorDB has set of clients in all these programming langauges and more see official clients

Production Use

Q: Is FalkorDB production-ready?
A: Yes, FalkorDB is stable for production use, being a continuation of the battle-tested RedisGraph codebase.

Troubleshooting

Q: What should I do if I get "libgomp.so.1: cannot open shared object file"?
A: Install OpenMP:

  • Ubuntu: apt-get install libgomp1
  • RHEL/CentOS: yum install libgomp
  • OSX: brew install libomp

Migration

Q: Can I migrate from Neo4j to FalkorDB?
A: Yes, FalkorDB supports the Cypher query language, making migration from Neo4j straightforward. Migration tools are in development.

Grafana and Prometheus

  • Accessing grafana http://localhost:3000
  • Accessing prometheus http://localhost:9090
  • sum by (vendor, spawn_id) (rate(operations_total{vendor="falkor"}[1m])) redis
  • rate(redis_commands_processed_total{instance=~"redis-exporter:9121"}[1m])
  • redis_connected_clients{instance=~"redis-exporter:9121"}
  • topk(5, irate(redis_commands_total{instance=~"redis-exporter:9121"} [1m]))
  • redis_blocked_clients
  • redis_commands_total
  • redis_commands_failed_calls_total
  • redis_commands_latencies_usec_count
  • redis_commands_rejected_calls_total
  • redis_io_threaded_reads_processed
  • redis_io_threaded_writes_processed
  • redis_io_threads_active
  • redis_memory_max_bytes
  • redis_memory_used_bytes
  • redis_memory_used_peak_bytes
  • redis_memory_used_vm_total
  • redis_process_id

About

A benchmarking tool to evaluate and compare the performance of graph databases with customizable workloads and metrics.

Topics

Resources

License

Stars

12 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors