From 26a0d864313c586b6e716664837725eff03f37f4 Mon Sep 17 00:00:00 2001 From: Alexey Bodanyuk <144894236+wfa22@users.noreply.github.com> Date: Mon, 19 Oct 2026 14:01:56 +0300 Subject: [PATCH] =?UTF-8?q?bench:=20=D0=BF=D0=BB=D0=B0=D0=BD=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B8=D0=B9=20=D1=82=D1=80=D0=B5=D0=BA=D0=B0=201?= =?UTF-8?q?=20(series.sh)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- bench/track1/series.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 bench/track1/series.sh diff --git a/bench/track1/series.sh b/bench/track1/series.sh new file mode 100755 index 0000000..40d584f --- /dev/null +++ b/bench/track1/series.sh @@ -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 +# sh bench/track1/series.sh improved +# ~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 " >&2; exit 2 ;; +esac