From e4b0baf53925c22f8cdbb467614e8d36b468636a Mon Sep 17 00:00:00 2001 From: Somesh Kumar Gouda Date: Wed, 22 Jul 2026 11:33:56 +0530 Subject: [PATCH 1/2] Makefile: add more bench-* targets for performance suite Extend the existing make bench-put workflow with additional make targets for range, txn-put, stm, lease-keepalive, watch, and watch-latency. Document usage in tools/benchmark/README.md. Signed-off-by: Somesh Kumar Gouda --- Makefile | 35 +++++++++++++++++++++++++++++++++++ tools/benchmark/README.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/Makefile b/Makefile index d86741d90a4..61c08f3712b 100644 --- a/Makefile +++ b/Makefile @@ -17,11 +17,46 @@ else @echo "benchmark tool already installed..." endif +# Benchmark make targets extend scripts/benchmark_test.sh (see #16467). +# Override defaults with ARGS, e.g.: +# make bench-put ARGS='--total=100000 --clients=100' +# make bench-range ARGS='foo --total=50000 --consistency=s' + .PHONY: bench-put bench-put: build install-benchmark @echo "Running benchmark: put $(ARGS)" ./scripts/benchmark_test.sh put $(ARGS) +.PHONY: bench-range +bench-range: build install-benchmark + @echo "Running benchmark: range $(ARGS)" + ./scripts/benchmark_test.sh range foo $(ARGS) + +.PHONY: bench-txn-put +bench-txn-put: build install-benchmark + @echo "Running benchmark: txn-put $(ARGS)" + ./scripts/benchmark_test.sh txn-put $(ARGS) + +.PHONY: bench-stm +bench-stm: build install-benchmark + @echo "Running benchmark: stm $(ARGS)" + ./scripts/benchmark_test.sh stm $(ARGS) + +.PHONY: bench-lease-keepalive +bench-lease-keepalive: build install-benchmark + @echo "Running benchmark: lease-keepalive $(ARGS)" + ./scripts/benchmark_test.sh lease-keepalive $(ARGS) + +.PHONY: bench-watch +bench-watch: build install-benchmark + @echo "Running benchmark: watch $(ARGS)" + ./scripts/benchmark_test.sh watch $(ARGS) + +.PHONY: bench-watch-latency +bench-watch-latency: build install-benchmark + @echo "Running benchmark: watch-latency $(ARGS)" + ./scripts/benchmark_test.sh watch-latency $(ARGS) + PLATFORMS=linux-amd64 linux-386 linux-arm linux-arm64 linux-ppc64le linux-s390x darwin-amd64 darwin-arm64 windows-amd64 windows-arm64 .PHONY: build-all diff --git a/tools/benchmark/README.md b/tools/benchmark/README.md index c3dbe919ee8..fbaee0ba2b3 100644 --- a/tools/benchmark/README.md +++ b/tools/benchmark/README.md @@ -22,6 +22,37 @@ Alternatively, instead of installing the tool, you can use it by simply running $ go run ./tools/benchmark ``` +## Running via make (local etcd) + +From the repository root, use the `bench-*` make targets. Each target builds etcd, +installs the benchmark tool if needed, starts a temporary local etcd process, runs +the named workload with `--report-perfdash`, then tears the server down +(see `scripts/benchmark_test.sh` and [#16467](https://github.com/etcd-io/etcd/issues/16467)). + +``` + $ make bench-put + $ make bench-range + $ make bench-txn-put + $ make bench-stm + $ make bench-lease-keepalive + $ make bench-watch + $ make bench-watch-latency +``` + +Pass extra flags through `ARGS`: + +``` + $ make bench-put ARGS='--total=100000 --clients=100 --conns=10' + $ make bench-range ARGS='--total=50000 --consistency=s --limit=100' +``` + +`bench-range` uses a default key of `foo`. For custom range bounds, call the +script directly: + +``` + $ ./scripts/benchmark_test.sh range mykey myend --total=10000 +``` + ## Usage The following command should output the usage per the latest development. From 19b0fc93b1712a92a58722f75cddafadf4241a56 Mon Sep 17 00:00:00 2001 From: Somesh Kumar Gouda Date: Thu, 23 Jul 2026 16:20:10 +0530 Subject: [PATCH 2/2] Documentation: fix markdown lint in benchmark README Signed-off-by: Somesh Kumar Gouda Signed-off-by: Somesh Kumar Gouda --- Makefile | 2 +- tools/benchmark/README.md | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 61c08f3712b..14f28d517ae 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ endif # Benchmark make targets extend scripts/benchmark_test.sh (see #16467). # Override defaults with ARGS, e.g.: # make bench-put ARGS='--total=100000 --clients=100' -# make bench-range ARGS='foo --total=50000 --consistency=s' +# make bench-range ARGS='--total=50000 --consistency=s' .PHONY: bench-put bench-put: build install-benchmark diff --git a/tools/benchmark/README.md b/tools/benchmark/README.md index fbaee0ba2b3..22837a0c10a 100644 --- a/tools/benchmark/README.md +++ b/tools/benchmark/README.md @@ -27,30 +27,31 @@ Alternatively, instead of installing the tool, you can use it by simply running From the repository root, use the `bench-*` make targets. Each target builds etcd, installs the benchmark tool if needed, starts a temporary local etcd process, runs the named workload with `--report-perfdash`, then tears the server down -(see `scripts/benchmark_test.sh` and [#16467](https://github.com/etcd-io/etcd/issues/16467)). +(see `scripts/benchmark_test.sh` and +[#16467](https://github.com/etcd-io/etcd/issues/16467)). -``` - $ make bench-put - $ make bench-range - $ make bench-txn-put - $ make bench-stm - $ make bench-lease-keepalive - $ make bench-watch - $ make bench-watch-latency +```bash +make bench-put +make bench-range +make bench-txn-put +make bench-stm +make bench-lease-keepalive +make bench-watch +make bench-watch-latency ``` Pass extra flags through `ARGS`: -``` - $ make bench-put ARGS='--total=100000 --clients=100 --conns=10' - $ make bench-range ARGS='--total=50000 --consistency=s --limit=100' +```bash +make bench-put ARGS='--total=100000 --clients=100 --conns=10' +make bench-range ARGS='--total=50000 --consistency=s --limit=100' ``` `bench-range` uses a default key of `foo`. For custom range bounds, call the script directly: -``` - $ ./scripts/benchmark_test.sh range mykey myend --total=10000 +```bash +./scripts/benchmark_test.sh range mykey myend --total=10000 ``` ## Usage