bench: план серий трека 1 (series.sh)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alexey Bodanyuk
2026-10-19 14:01:56 +03:00
co-authored by Claude Opus 5.5
parent 3f45eb1b51
commit 26a0d86431
+37
View File
@@ -0,0 +1,37 @@
#!/bin/sh
# The exact track 1 experiment plan (REPORT.md, "Трек 1"). Every series starts fresh stands and
# measures the API image built from the given commit. Stop the main stand first (CPU noise):
# docker compose stop
# sh bench/track1/series.sh baseline <commit-before-the-improvement>
# sh bench/track1/series.sh improved <commit-with-the-improvement>
# ~2.5 h for `baseline`, ~1.5 h for `improved` on the reference laptop (see meta.json files).
set -eu
cd "$(dirname "$0")/../.."
PY="${PYTHON:-$(command -v python3 || command -v python)}"
phase="${1:?baseline or improved}"
ref="${2:-HEAD}"
run() { "$PY" bench/track1/run.py --git-ref "$ref" --repeats "${REPEATS:-3}" "$@"; }
case "$phase" in
baseline)
# A. Fixed total API budget 2.0 CPU / 768 MiB split into 1, 2, 4 replicas; PostgreSQL 2.0 CPU.
run --series A-fixed-total --label baseline --rates 100,150,200,250,300,350 \
--config replicas=1,api_cpus=2.0,api_memory=768m \
--config replicas=2,api_cpus=1.0,api_memory=384m \
--config replicas=4,api_cpus=0.5,api_memory=192m
# B. Growing API resources (1, 2, 3 replicas x 1.0 CPU) against a NARROW database (0.5 CPU).
run --series B-replicas-vs-db --label baseline --rates 100,150,200,250,300,350,400 \
--config replicas=1,pg_cpus=0.5 --config replicas=2,pg_cpus=0.5 --config replicas=3,pg_cpus=0.5
# C. Growing database resources (0.5 -> 1.0 -> 2.0 CPU) at 3 API replicas: does the ceiling move?
run --series C-db-growth --label baseline --rates 200,250,300,350,400,450,500 \
--config replicas=3,pg_cpus=1.0 --config replicas=3,pg_cpus=2.0
;;
improved)
# D. The improvement (single-round-trip write) against the old write path on the SAME image,
# in the API-bound (2 x 1.0, PG 2.0) and the DB-bound (3 x 1.0, PG 0.5) configurations.
run --series D-improvement --label "$ref" --rates 150,200,250,300,350,400,450,500 \
--config replicas=2,MESSAGE_WRITE_PATH=multi --config replicas=2,MESSAGE_WRITE_PATH=function \
--config replicas=3,pg_cpus=0.5,MESSAGE_WRITE_PATH=multi --config replicas=3,pg_cpus=0.5,MESSAGE_WRITE_PATH=function
;;
*) echo "usage: series.sh baseline|improved <git-ref>" >&2; exit 2 ;;
esac