Files
mtusi2026lab2/bench/bench.compose.yml
T
ricoromaandClaude Opus 5.5 e76eed789f feat: run load bench on PostgreSQL with query plans
- bench stand is a separate compose project mtusi-bench (API, Postgres,
  Valkey) with fixed limits, fresh volume per size and migrations
- k6 registers with a password, logs in with Basic and sends Bearer
- VACUUM (ANALYZE) and CHECKPOINT after prefill
- EXPLAIN (ANALYZE, BUFFERS) of the app's history query via auto_explain,
  plus the same query without the index in a rolled back transaction
- Postgres CPU, table and index size in results; storages in passport
- bench_compare checks storage limits, images and settings
- remove inproc.py and make bench_inproc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 01:21:15 +03:00

53 lines
2.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Override стенда make bench (bench/run.py): тот же docker-compose.yml под
# проектом mtusi-bench, со своими volume, сетью и лимитами. Пины, healthcheck
# хранилищ, valkey.conf и миграции — из основного файла. Подстановки — из
# bench/bench.env, а не из .env рабочего стенда; пароли и BENCH_* передаёт
# run.py (поля Profile), без них стенд не поднимается. Решения 1, 2, 5 design
# change bench-postgres; что не меняется между метками — .claude/rules/bench.md.
services:
postgres:
container_name: mtusi-bench-postgres
# упавший контейнер не поднимается сам: прогон помечается stand_down
restart: "no"
# auto_explain загружен, но выключен (log_min_duration = -1): run.py
# включает его только на этапе плана, между прогонами
command: ["postgres", "-c", "shared_preload_libraries=auto_explain"]
ports: !reset []
cpus: ${BENCH_DB_CPUS:?run make bench}
mem_limit: ${BENCH_DB_MEMORY:?run make bench}
memswap_limit: ${BENCH_DB_MEMORY:?run make bench}
valkey:
container_name: mtusi-bench-valkey
restart: "no"
ports: !reset []
cpus: ${BENCH_CACHE_CPUS:?run make bench}
mem_limit: ${BENCH_CACHE_MEMORY:?run make bench}
memswap_limit: ${BENCH_CACHE_MEMORY:?run make bench}
migrate:
image: mtusi-messenger:bench
# без config.toml рабочего стенда: настройки — окружение и дефолты
volumes: !reset []
api:
container_name: mtusi-bench-api
image: mtusi-messenger:bench
restart: "no"
ports: !reset []
volumes: !reset []
# проверка раз в несколько секунд — лишний CPU внутри лимита API
healthcheck:
disable: true
environment:
# размер 1M идёт дольше часа по умолчанию: сессия не должна истечь
AUTH__SESSION_TTL_SECONDS: ${BENCH_SESSION_TTL_SECONDS:?run make bench}
cpus: ${BENCH_APP_CPUS:?run make bench}
mem_limit: ${BENCH_APP_MEMORY:?run make bench}
memswap_limit: ${BENCH_APP_MEMORY:?run make bench}
networks:
default:
# k6 подключается к сети стенда по имени (docker run --network)
name: mtusi-bench