Files
mtusi2026labs/scripts/host-snapshot.sh
T
ArtyomandClaude Opus 5.5 8ea1996063 Add the series orchestrator and samplers for track 1
scripts/scaling.py applies a replicas x CPU layout through compose
variables: workers equal to the replica CPUs, a pool of 8 per worker,
a balancer queue of 32 per worker so every layout of a series offers
the same concurrency to the API, and the replicas pinned to CPUs 7 and
up, next to PostgreSQL on 0-1, the balancer on 2, Valkey on 3 and k6
on 4-6 with 3 CPU and 1 GiB. For every offered rate it runs k6 three
times and stops a config after two steps saturated in all repeats.

Each step keeps its raw data: k6 summary, docker stats, HAProxy
statistics and pg_stat_activity sampled every second, and the top of
pg_stat_statements. The summary row carries CPU per component,
PostgreSQL active, idle, idle in transaction and lock waiting backends,
the balancer queue and the database size. Several variants alternate
per repeat for before and after runs. host-snapshot.sh records every
container on the host before a series.

make track1-a and track1-b run the fixed budget and the growth series
from an empty database.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-28 20:25:23 +03:00

21 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
set -eu
out=${1:?usage: host-snapshot.sh <file>}
cd "$(dirname "$0")/.."
mkdir -p "$(dirname "$out")"
{
echo "date: $(date -u +%FT%TZ) commit: $(git rev-parse --short HEAD)"
echo "host: $(sysctl -n machdep.cpu.brand_string 2>/dev/null || uname -m), $(sysctl -n hw.ncpu 2>/dev/null || nproc) CPU, macOS $(sw_vers -productVersion 2>/dev/null || uname -r)"
echo "docker: $(docker version --format '{{.Server.Version}}'), compose $(docker compose version --short), VM $(docker info --format '{{.NCPU}} CPU, {{.MemTotal}} bytes')"
echo
echo "\$ docker stats --no-stream --all # every container on the host, before the series"
docker stats --no-stream --all --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.PIDs}}'
echo
echo "\$ docker ps --format '{{.Names}} {{.Image}} {{.Status}}'"
docker ps --format '{{.Names}} {{.Image}} {{.Status}}'
echo
echo "\$ docker compose --profile bench config --images"
docker compose --profile bench config --images
} > "$out"
cat "$out"