Files
mtusi2026lab3/evidence/tests/bench-self-checks.md
T
ricoromaandClaude Opus 5.5 de93056eab docs: add replicas-lb evidence and report
Evidence from 4e0cc4e: stand ports, limits and per-service env,
X-Instance-Id distribution and scaling, LB-generated errors,
test-persistence through the LB, test-failover for each replica in stop
and kill modes, stop-one refusals, test runs and bench self-checks.
REPORT.md gains the LB architecture, timeout chain, limits, criteria
rows and defence answers. Coverage exclusions for restart now point to
the lab 3 persistence evidence; stale lab 2 pointers go to
KNOWN_ISSUES.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 18:31:18 +03:00

61 lines
4.1 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.
# Самопроверки стенда `bench/` на compose с балансировщиком
| | |
|---|---|
| Спеки | `load-benchmark` «Запуск одной командой», «Фиксированный стенд» — «Лимиты в паспорте» (стенд остаётся одним API без LB до change `graceful-failover`) |
| Change | `replicas-lb`, задача 4.2 (повтор с закоммиченного кода — 6.1) |
| Дата | 2026-10-10 15:15:09–15:20:44 UTC |
| Commit | `4e0cc4e`, `dirty: false` в паспортах обеих меток |
| Стенд | проект compose `mtusi-bench`: `docker-compose.yml` + `bench/bench.compose.yml`; `api` — одна реплика (`deploy.replicas: 1`, `container_name: mtusi-bench-api`), `haproxy` не запускается; лимиты в форме `deploy.resources.limits` |
| Хост | Docker Desktop 29.8.1, macOS arm64; ВМ Docker: 12 CPU, 7,7 GiB RAM; `host_warnings` паспорта: «host on battery power», «swap used 1476 MiB > 1024 MiB» — самопроверка, не замер |
Основной compose теперь задаёт лимиты в `deploy.resources.limits`, а
`cpus` / `mem_limit` рядом с ними compose не принимает (`can't set
distinct values on 'mem_limit' and 'deploy.resources.limits.memory'`).
Override стенда переведён на ту же форму, те же переменные `BENCH_*`,
и держит одну реплику `api` (`container_name` с `replicas` > 1 compose
тоже не принимает). Каталоги `quick-*` в git не идут (`bench.md`).
## `make bench_quick`
```text
$ make bench_quick # exit 0, 3 мин 24 с
[00:00:00] image mtusi-messenger:bench built (sha256:c41b64e684a6…), compose project mtusi-bench
[00:00:12] size 1k: 62 background chats, 4500 messages to prefill
...
[00:03:24] complete: 18/18 runs, results in evidence/bench/quick-20261010T151509Z
```
18 из 18 прогонов, во всех `err 0`.
## `make bench_restore_quick`
```text
$ make bench_restore_quick # exit 0, 2 мин 9 с
[00:00:29] size 1k: backup 0.6 MiB in 0.14s during 1000 writes (0 failed)
[00:00:36] size 1k: restored 4588 of 5501 messages (913 lost after the snapshot), restore 0.08s, ANALYZE 0.11s, API 2.31s, RTO 3.88s; stale chat GET 200 POST 500, after FLUSHALL 404
[00:01:12] size 5k: backup 1.1 MiB in 0.14s during 1000 writes (0 failed)
[00:01:18] size 5k: restored 8583 of 9501 messages (918 lost after the snapshot), restore 0.13s, ANALYZE 0.11s, API 2.34s, RTO 3.97s; stale chat GET 200 POST 500, after FLUSHALL 404
[00:02:01] size 10k: backup 1.7 MiB in 0.18s during 1000 writes (0 failed)
[00:02:07] size 10k: restored 13594 of 14501 messages (907 lost after the snapshot), restore 0.14s, ANALYZE 0.13s, API 2.18s, RTO 3.73s; stale chat GET 200 POST 500, after FLUSHALL 404
[00:02:09] complete: 0/0 runs, results in evidence/bench/quick-restore-20261010T151835Z
```
«Потерянные после снимка» сообщения и `POST 500` на устаревший чат —
наблюдения методики трека 2 лабы 2, как в
`bench-restore-quick.md`, а не ошибки стенда.
## Лимиты в паспорте до и после
`meta.json` → `limits` (из `docker inspect` запущенных контейнеров):
| Метка | Commit | api | postgres | valkey |
|---|---|---|---|---|
| `quick-20261008T140114Z` (до change, `cpus` / `mem_limit`) | `0ab3a34`, dirty | 1 CPU, 2048 / 2048 MiB | 4 CPU, 3072 / 3072 MiB | 2 CPU, 512 / 512 MiB |
| `quick-20261010T151509Z` | `4e0cc4e` | 1 CPU, 2048 / 2048 MiB | 4 CPU, 3072 / 3072 MiB | 2 CPU, 512 / 512 MiB |
| `quick-restore-20261010T151835Z` | `4e0cc4e` | 1 CPU, 2048 / 2048 MiB | 4 CPU, 3072 / 3072 MiB | 2 CPU, 512 / 512 MiB |
(CPU — `NanoCpus / 1e9`, память — `Memory` / `MemorySwap`.) Лимиты
контейнеров те же, что до смены формы записи: метки `bench` до и после
change сравнимы по этому полю паспорта.