Files
mtusi2026lab3/openspec/changes/add-lab3-scaling-cost/tasks.md
T
ArtyomandClaude Opus 5.5 be19abf364 Record the fixed budget series of track 1
1x4, 2x2 and 4x1 at 4 CPU and 2 GiB of API, workers equal to CPUs,
32 pool connections and 128 balancer slots in every layout, three
repeats from 600 to 6 830 rps. All three keep up with the offered
load up to 4 560 rps; the peaks are 5 375 rps for 1x4 (5 332..5 384),
4 964 for 2x2 (4 894..5 104) and 4 724 for 4x1 (4 686..4 794). At the
peak the API uses 95 % of its four CPUs in every layout, PostgreSQL
82..89 % of its two, the balancer 40 % of one, and about half of the
32 database connections wait for the lock on a chat row.

Smaller replicas cost more: at 3 040 rps the API burns 215 % CPU as
1x4, 243 % as 2x2 and about 280 % as 4x1, and p95 at 4 560 rps grows
from 9 to 69 and 150 ms.

The first attempt was aborted when a neighbour's image build froze the
Docker API; its summary is kept under aborted/. Twelve steps of the
rerun were rejected as disturbed and repeated. A config's SLO capacity
now needs a majority of saturated repeats, since a median is robust to
one disturbed repeat and "any repeat" is not. Series B starts at 450
rps per CPU.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
2026-10-29 00:31:43 +03:00

32 lines
2.4 KiB
Markdown
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.
## 1. Стенд под измерения
- [x] 1.1 `compose.yaml`: закрепление CPU каждого сервиса через `*_CPUSET` (пусто по умолчанию), `.env.example`
- [x] 1.2 Проверка группы: `docker compose --profile bench config --quiet`, `make limits` по-прежнему `PASS`
## 2. Сэмплеры и оркестратор
- [x] 2.1 `scripts/docker-stats.sh`, `scripts/lb-stats.sh`, `scripts/pg-stats.sh` (activity, statements, reset, размер базы)
- [x] 2.2 `scripts/scaling.py`: конфигурация `RxC` с воркерами, пулом, очередью LB на реплику и закреплением CPU; ожидание ровно R реплик в LB; поиск колена с повторами; варианты «до/после» с чередованием; `summary.csv` и сырьё шага
- [ ] 2.3 `tools/plot_track1.py` и `make plots`; цели `make track1-a`, `track1-b`, `track1-compare`, `track1`
- [x] 2.4 Проверка группы: `make lint`, `make check`, пробный шаг `scaling.py` на одной интенсивности
## 3. Серии
- [x] 3.1 Снимок `docker stats` всего хоста, версии и лимиты → `evidence/track1/`
- [x] 3.2 Серия A: 1×4, 2×2, 4×1 при 4 CPU / 2 GiB, ≥3 повтора
- [ ] 3.3 Серия B: 1×1, 2×1, 8×1 (4×1 — из серии A), ≥3 повтора
- [ ] 3.4 Проверка группы: насыщенное звено названо по метрикам `summary.csv` и топу `pg_stat_statements`
## 4. Улучшение
- [ ] 4.1 Выбор улучшения по узкому месту серии B, запись в `design.md`
- [ ] 4.2 Реализация улучшения
- [ ] 4.3 `make track1-compare`: до и после на той же конфигурации и интенсивностях, ≥3 повтора
- [ ] 4.4 Проверка группы: `make lint`, `make student-test`, `make test`
## 5. Отчёт
- [ ] 5.1 `make plots`, `evidence/track1/README.md` с картой файлов
- [ ] 5.2 `REPORT.md`: раздел трека 1 — гипотезы, методика, таблицы серий, насыщение, улучшение, ограничения, выводы
- [ ] 5.3 Проверка группы: `make check`, `make lint`, `make student-test`, `make test`