Archive the scaling cost change

Track 1 of grade 5 is closed. At a fixed 4 CPU / 2 GiB the 1x4, 2x2
and 4x1 layouts peak at 5 375, 4 964 and 4 724 rps: within the
hypothesised 15 percent, yet smaller replicas cost a third more CPU
per request and reach a long tail earlier. Growing one-CPU replicas
gives 1 720, 2 936, 4 724 and only 4 260 rps at eight, a retrograde
curve with USL sigma 0.014 and kappa 0.038. The saturation point is
the chat row lock in PostgreSQL: at eight replicas 47.5 of 64
connections wait for it while the API, the balancer and the database
CPU still have room. Writing a message with one statement removed the
application round trips from under the lock: p95 at 3 600 rps fell
from 64.5 to 3.7 ms and the peak rose by 15 % with the same resources.

The new lab3-scaling-cost spec is synced to openspec/specs, with the
compare scenario stated as measured: below the knee fewer lock waits
and a lower p95, past it a higher peak. AGENTS.md lists make track1
and make plots. The neighbour CPU sampler is stopped and its file
closed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
This commit is contained in:
Artyom
2026-10-29 01:42:38 +03:00
co-authored by Claude Opus 5.5
parent 3e63b16ca6
commit e88673dfec
7 changed files with 90 additions and 2 deletions
@@ -1,2 +1,4 @@
schema: spec-driven
created: 2026-10-28
archived: 2026-10-29
lab: 3
@@ -75,8 +75,8 @@
#### Scenario: Под нагрузкой транзакции не ждут приложение
- **WHEN** выполняется `make track1-compare` на 8×1 при насыщающей интенсивности
- **THEN** у варианта «после» в `pg_stat_activity` среднее число соединений `idle in transaction` близко к нулю, ожиданий блокировки меньше, чем «до», а пик успешных RPS выше, чем «до», с непересекающимися интервалами повторов
- **WHEN** выполняется `make track1-compare` на 8×1
- **THEN** у варианта «после» в `pg_stat_activity` среднее число соединений `idle in transaction` близко к нулю на любой интенсивности; ниже колена ожиданий блокировки и p95 меньше, чем «до»; за коленом пик успешных RPS выше, чем «до», с непересекающимися интервалами повторов
#### Scenario: Отстающие часы реплики не ломают порядок