The benchmarks crate contains currently the following benchmarks:
- sequential_throughput: Runs the Restate runtime and ingest counter.Counter/GetAndAdd requests sequentially (same key)
- parallel_throughput: Runs the Restate runtime and ingest counter.Counter/GetAndAdd requests concurrently (random key)
All benchmarks can be run via:
cargo bench --package restate-benchmarks To run a single benchmark run it via:
cargo bench --package restate-benchmarks --bench throughput_parallelPrerequisites:
- (Linux only) You need to set
kernel.perf_event_paranoidto-1to allow perf collect all the events:sudo sysctl kernel./perf_event_paranoid=-1
In order to profile the benchmarks select a benchmark and pass the --profile-time=<time_to_run> option:
cargo bench --package restate-benchmarks --bench throughput_parallel -- --profile-time=30On MacOS you need to enable the frame-pointer feature:
cargo bench --package restate-benchmarks --features frame-pointer --bench throughput_parallel -- --profile-time=30This will profile the throughput_parallel benchmark for 30 s. The profiler will generate a flamegraph under target/criterion/<name_of_benchmark>/profile/flamegraph.svg.
The benchmarks spawn Restate with a default configuration. You can overwrite this configuration by specifying environment variables of the form RESTATE_WORKER__PARTITIONS=1337.
The parallel benchmark can be configured via environment variables:
BENCHMARK_REQUESTS: Number of requests to send to the Restate runtime (default: 4000)BENCHMARK_PARALLEL_REQUESTS: Number of parallel requests (default: 1000)BENCHMARK_SAMPLE_SIZE: Number of samples to take (default: 20)