11 Commits
575 changed files with 433237 additions and 36 deletions
+41 -11
View File
@@ -1,13 +1,43 @@
# Copy to .env for your LOCAL synthetic test environment; never commit .env.
# These are logical interface suggestions; map actual framework names in REPORT.md.
APP_HOST=0.0.0.0
APP_PORT=8080
# Copy to .env for this LOCAL synthetic teaching stand: `make env` generates
# random local credentials and never prints them. .env is ignored by Git.
# These are logical settings; compose.yaml maps them to the application.
APP_ENV=lab
SESSION_TTL_SECONDS=3600
# Choose credentials locally. File paths contain no secret values.
DATABASE_URL_FILE=/run/secrets/database_url
# Optional on 3, required use on 4 in lab2; Redis OR Valkey:
SESSION_STORE=postgres
CACHE_URL_FILE=/run/secrets/cache_url
LOG_LEVEL=info
APP_VERSION=1.0.0
# Local credentials. Never commit real values.
POSTGRES_USER=messenger
POSTGRES_DB=messenger
POSTGRES_PASSWORD=
VALKEY_PASSWORD=
# Public entrypoint: HAProxy on loopback only. API replicas have no host port.
LB_PORT=8083
# Replica count and per-replica limits. For track-1 runs the experiment script
# keeps the total constant: 1x0.8, 2x0.4, 4x0.2 CPU and 1x512M, 2x256M, 4x128M.
API_REPLICAS=2
IDEMPOTENCY_TTL_SECONDS=86400
API_CPU_LIMIT=0.4
API_MEM_LIMIT=256M
GOMEMLIMIT=220MiB
POSTGRES_CPU_LIMIT=0.7
POSTGRES_MEM_LIMIT=512M
VALKEY_CPU_LIMIT=0.1
VALKEY_MEM_LIMIT=128M
LB_CPU_LIMIT=0.2
LB_MEM_LIMIT=64M
SESSION_TTL_SECONDS=3600
DB_MAX_CONNS=8
DB_MIN_CONNS=1
DB_CONNECT_TIMEOUT_SECONDS=3
DB_STATEMENT_TIMEOUT_SECONDS=3
DB_QUERY_TIMEOUT_SECONDS=3
CACHE_POOL_SIZE=8
CACHE_TIMEOUT_SECONDS=2
SHUTDOWN_TIMEOUT_SECONDS=6
SHUTDOWN_DRAIN_SECONDS=3
STARTUP_TIMEOUT_SECONDS=30
# Build metadata, filled by make if not supplied.
GIT_REVISION=unknown
+60
View File
@@ -0,0 +1,60 @@
# syntax=docker/dockerfile:1
# Compile stage. Dependencies are vendored, so the build needs no module proxy
# and the same source tree produces the same binary from a clean clone.
FROM golang:1.25.1-alpine3.22@sha256:b6ed3fd0452c0e9bcdef5597f29cc1418f61672e9d3a2f55bf02e7222c014abd AS build
WORKDIR /src
ENV CGO_ENABLED=0 \
GOTOOLCHAIN=local \
GOFLAGS=-mod=vendor
COPY go.mod go.sum ./
COPY vendor ./vendor
COPY cmd ./cmd
COPY internal ./internal
ARG VERSION=1.0.0
ARG REVISION=unknown
RUN go build \
-trimpath \
-buildvcs=false \
-ldflags="-s -w -buildid= -X main.version=${VERSION} -X main.revision=${REVISION}" \
-o /out/messenger \
./cmd/messenger \
&& go build \
-trimpath \
-buildvcs=false \
-ldflags="-s -w -buildid= -X main.revision=${REVISION}" \
-o /out/migrate \
./cmd/migrate
# Runtime stage: minimal Alpine pinned by digest, no shell tooling and no
# package manager calls. The process runs as the unprivileged uid 10001.
FROM alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 AS runtime
LABEL org.opencontainers.image.title="mtusi-messenger-lab3" \
org.opencontainers.image.description="MTUSI highload lab 3: HAProxy, replicated API, shared PostgreSQL and Valkey" \
org.opencontainers.image.version="1.0.0"
WORKDIR /app
COPY --from=build --chown=10001:10001 /out/messenger /app/messenger
COPY --from=build --chown=10001:10001 /out/migrate /app/migrate
USER 10001:10001
EXPOSE 8080
ENV APP_HOST=0.0.0.0 \
APP_PORT=8080 \
APP_ENV=lab \
LOG_LEVEL=info \
SESSION_TTL_SECONDS=3600 \
SHUTDOWN_TIMEOUT_SECONDS=6 \
SHUTDOWN_DRAIN_SECONDS=3
# The same binary implements -healthcheck, so the image needs no curl/wget and
# the probe runs as the unprivileged user.
HEALTHCHECK --interval=3s --timeout=2s --start-period=10s --retries=3 \
CMD ["/app/messenger", "-healthcheck"]
ENTRYPOINT ["/app/messenger"]
+72
View File
@@ -0,0 +1,72 @@
# ЛР 3 — БВТ2301 — Мельников Иван — на 5
- **Базовая лабораторная:** `mtusi2026lab3`, ветка `main`,
исходная ревизия `0ab3a341aa7ba32363ce43061d4ff02b1f2964af`.
- **Ветка решения:** `solution/bvt2301-melnikov`.
- **Финальный принятый commit (код + evidence):**
`a339f65ed0081e41882e21bc0392b254558265c1`, дерево чистое; публикационные
правки этого файла и `REPORT.md` — отдельным docs-коммитом поверх.
- **Fork/PR:** https://gitea.privcloud.tech/MelnikStalker/mtusi2026lab3;
ветка `solution/bvt2301-melnikov` опубликована, MR открыт в
`mtusi2026/mtusi2026lab3` (base `main`).
- **Целевая оценка:** 5. **Трек 5:** трек 1 «Цена масштабирования».
- **Заголовок PR:** `ЛР 3 — БВТ2301 — Мельников — на 5`.
## Что в PR
- `compose.yaml`: HAProxy → 2+ API-реплики → общие PostgreSQL 16.4 и
Valkey 8.0.2; одноразовый `migrate`; лимиты CPU/RAM; без `container_name`;
у API нет опубликованных портов.
- `infra/haproxy.cfg`: активные проверки `/health/ready`, Docker DNS
`server-template`, без sticky session, статистика только на loopback.
- `cmd/messenger`: общий `X-Instance-Id`, строгий `Idempotency-Key`,
атомарная запись сообщения и idempotency-записи одним CTE, graceful drain.
- `cmd/migrate`: отдельные миграции с advisory lock и checksums.
- `cmd/loadgen`, `scripts/`: собственные проверки, failover-матрица,
rolling update, track-1 эксперимент, SVG-графики.
- `student-tests/blackbox.py`: 141 black-box проверка.
- `REPORT.md`, `MR.md`, `evidence/`: результаты и воспроизводимые команды.
## Как проверялось
```sh
make env
make up
make check
make validate PYTHON=.venv/bin/python
make test
make test-student
make test-failover ACTION_SCRIPT=scripts/stop-one.sh
make test-persistence ACTION_SCRIPT=scripts/restart.sh
make test-container
make test-db
make failover-each
make test-failure
make rolling
python3 scripts/track1.py
```
Фактические результаты: public smoke, 141 black-box проверка, Go tests/vet/race,
failover каждой реальной реплики (0 ошибок, first success 0.002–0.003 с),
persistence с прежним токеном, DB-checks (migrations 1,2,3; 509k/509k; 0
дубликатов), rolling update (183 848 запросов, 0 ошибок, версии 1.0.0 и
2.0.0) и track-1 (24 прогона; 1/2/4 реплики: 1228.8/1542.0/1585.9 RPS;
улучшение +46.9%). Подробности, image id и ограничения — в `REPORT.md` и
`evidence/`. Публичные `tests/`, `contracts/`, `README.md`, `COURSE.md`,
`CONTRIBUTING.md`, `lab.json` не изменялись.
## Совместимость и откат
- Схема только аддитивная: lab2-таблицы сохранены, добавлена
`message_idempotency` (миграция `0003`). Повторный `migrate` — no-op.
- Откат приложения — вернуть предыдущий image tag и пересоздать API-реплики;
данные и сессии в общих PostgreSQL/Valkey не удаляются.
- `make stop`/`make down` сохраняют volumes. `make purge` — единственная
намеренно разрушительная команда.
## Ограничения
Один Docker-host и одна БД: проверяется отказ процесса API, а не узла; LB,
PostgreSQL и Docker-host остаются SPOF. Сессии в Valkey с AOF everysec:
жёсткая потеря хоста может потерять до 1 с сессионных записей. Абсолютные
RPS — локальные, не SLA.
+80 -5
View File
@@ -1,13 +1,29 @@
PYTHON ?= python3
BASE_URL ?= http://localhost:8080
GO ?= go
BASE_URL ?= http://127.0.0.1:8083
CA_FILE ?=
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
COMPOSE ?= ./scripts/compose.sh
COMPOSE_ARGS = --env-file .env
IMAGE ?= mtusi-messenger-lab3-melnikov:local
GIT_REVISION ?= $(shell git rev-parse HEAD 2>/dev/null || echo unknown)
export GIT_REVISION
export API_IMAGE ?= $(IMAGE)
.PHONY: help check validate test load test-persistence test-failover
.PHONY: help check validate env up wait build-image docker-config stop down purge logs ps \
test load test-persistence test-failover test-student test-student-race \
test-expiry test-failure test-container test-db track1 failover-each rolling
help:
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API"
@echo "env: create ignored .env with random local credentials; up: build+start stack; wait: wait for /health/ready"
@echo "stop: stop containers (data kept); down: remove containers (volumes kept); purge: DELETE volumes and data"
@echo "test-student: Go unit tests + black-box suite; test-student-race: Go race detector"
@echo "test-persistence: ACTION_SCRIPT=scripts/restart.sh; test-failover: ACTION_SCRIPT=scripts/stop-one.sh"
@echo "failover-each: stop every real API replica in turn and measure RPS/errors/recovery"
@echo "track1: level-5 track 1 (scaling price, saturation, one improvement)"
@echo "rolling: rolling replacement of API containers under load"
check:
$(PYTHON) scripts/check_contract.py
@@ -21,10 +37,69 @@ test:
load:
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
env:
./scripts/init-env.sh
up:
@test -f .env || (echo "Run make env first" >&2; exit 2)
GIT_REVISION="$(GIT_REVISION)" API_IMAGE="$(IMAGE)" $(COMPOSE) $(COMPOSE_ARGS) up -d --build
./scripts/wait-ready.sh
wait:
./scripts/wait-ready.sh
build-image:
@test -f .env || (echo "Run make env first" >&2; exit 2)
GIT_REVISION="$(GIT_REVISION)" API_IMAGE="$(IMAGE)" $(COMPOSE) $(COMPOSE_ARGS) build api
docker-config:
GIT_REVISION="$(GIT_REVISION)" API_IMAGE="$(IMAGE)" $(COMPOSE) $(COMPOSE_ARGS) config --quiet
stop:
$(COMPOSE) $(COMPOSE_ARGS) stop
down:
$(COMPOSE) $(COMPOSE_ARGS) down
purge:
@echo "PURGE removes containers AND named volumes mtusi-lab3-melnikov-*: all synthetic data is lost."
$(COMPOSE) $(COMPOSE_ARGS) down -v
logs:
$(COMPOSE) $(COMPOSE_ARGS) logs --tail=100 api
ps:
$(COMPOSE) $(COMPOSE_ARGS) ps
test-persistence:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook" >&2; exit 2)
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
test-failover:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable stop-one hook"; exit 2)
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable stop-one hook" >&2; exit 2)
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
test-student:
$(GO) test -count=1 ./...
$(PYTHON) student-tests/blackbox.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-student-race:
$(GO) test -race -count=1 ./...
failover-each:
$(PYTHON) scripts/failover-matrix.py --base-url "$(BASE_URL)" $(TLS_ARGS)
rolling:
./scripts/rolling-update.sh
test-failure:
$(PYTHON) scripts/failure-checks.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-container:
$(PYTHON) scripts/container-checks.py --base-url "$(BASE_URL)" $(TLS_ARGS) --image "$(IMAGE)"
test-db:
$(PYTHON) scripts/db-checks.py
track1:
$(PYTHON) scripts/track1.py --base-url "$(BASE_URL)" $(TLS_ARGS)
+355 -20
View File
@@ -1,37 +1,372 @@
# Отчёт — лабораторная 3
# Отчёт — лабораторная 3. Балансировка и отказ API-реплики
- Автор, группа: TODO
- Целевая оценка; выбранный трек 5, если нужен: TODO
- Commit/PR: TODO после публикации
- Использованные источники, библиотеки и помощь ИИ: TODO
- **Автор, группа:** Мельников Иван Дмитриевич, БВТ2301.
- **Целевая оценка:** 5. **Трек 5:** трек 1 «Цена масштабирования».
- **Официальный репозиторий:** `mtusi2026lab3`,
`https://gitea.privcloud.tech/mtusi2026/mtusi2026lab3.git`.
- **Фактически использованная исходная ревизия:** `0ab3a341aa7ba32363ce43061d4ff02b1f2964af`
(ветка `main`; HEAD клона совпал).
- **Ветка решения:** `solution/bvt2301-melnikov`.
- **База из lab2:** `/Users/ivanmuller/Desktop/oh_my_life/highload/lab2`,
commit `d8b178e290befcaed641ddd7fa97c95e22813284`, ветка
`solution/bvt2301-melnikov`. Lab1/lab2 не изменялись.
- **Кодовая ревизия:** `922a38b2cf98f3e0b79fd605a21e42fc30ff1028`.
- **Финальный принятый commit (код + REPORT/MR + evidence):**
`a339f65ed0081e41882e21bc0392b254558265c1`. Дерево чистое
(`git status --porcelain` — 0 строк). Публикационные docs-правки идут
отдельным коммитом поверх него.
- **Fork:** https://gitea.privcloud.tech/MelnikStalker/mtusi2026lab3.
- **Образ приложения:** `mtusi-messenger-lab3-melnikov:local`, image id `sha256:c999351dd1ef2d2199d0bfeb73f057d80cee077afef267e97c3de9a10ef7ed48`,
revision label `922a38b2cf98f3e0b79fd605a21e42fc30ff1028`.
- **Целевой образ обновления (rolling):** `mtusi-messenger-lab3-melnikov:rolling`,
image id `sha256:7b7cf471e2f553b511641f5fb292fb35249a29d77067a0a8402aa6e7ee69c2c7`, version `2.0.0`.
- **Fork/PR:** https://gitea.privcloud.tech/MelnikStalker/mtusi2026lab3;
ветка `solution/bvt2301-melnikov` опубликована, MR открыт в
`mtusi2026/mtusi2026lab3` (base `main`).
## Итог
Стенд: **клиент → HAProxy → 2+ независимых API-процесса → общие PostgreSQL
16.4 и Valkey 8.0.2**. API не имеет опубликованных портов и локального
состояния, от которого зависит корректность. Одна сессия обслуживается
разными репликами без sticky session; у каждого процесса свой стабильный
`X-Instance-Id`. Обязательный `Idempotency-Key` реализован в PostgreSQL в
области «пользователь + метод + путь чата + ключ»: повтор возвращает тот же
`201` и тот же `Message`, другой body — `409`, конкурентные повторы через
разные реплики дают ровно одну запись, а вставка сообщения и idempotency-
записи выполняется одним атомарным CTE. Неподтверждённый POST можно
безопасно повторить с тем же ключом.
Публичные `make check`, `make validate`, `make test`, `make test-persistence`,
`make test-failover` проходят; собственные 141 black-box проверка и Go-тесты
проходят на Python 3.9.6 и Go 1.25.1. Публичный failover наблюдал ≥2
реплики; отдельная матрица остановила и восстановила каждый реальный
API-контейнер, подтвердив отсутствие ошибок и восстановление за доли
секунды. Перезапуск всего стенда с сохранёнными volumes сохранил прежний
токен и данные. Rolling update под нагрузкой заменил контейнеры по одному;
повторный `migrate` во время работы старых реплик — no-op.
Трек 1: при фиксированных 0.8 vCPU / 512 MiB на API сравнены 1/2/4 реплики;
затем серия роста API CPU 0.4→0.7→0.9 vCPU. Точка насыщения — **общая
PostgreSQL**: её cgroup CPU выходит на ~0.67–0.69 из 0.70, появляется
throttling, а рост числа API-реплик и их CPU почти не увеличивает RPS.
HAProxy использует ~0.10 из 0.20 vCPU и не даёт очереди; pgx pool насыщается
только при одной реплике (до 98% acquire-wait), после чего DB всё равно
ограничивает систему. Подтверждённое улучшение: атомарный CTE вместо
транзакции с отдельными INSERT даёт **46.9** RPS при том же
профиле и лимитах.
## Запуск из чистого clone
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
Требования: Docker Engine/Compose (проверено Docker 27.4.0 в Colima,
Compose 2.37.0 standalone), Python 3.9+ для публичных проверок. Go нужен
только для `go test`; приложение собирается в закреплённом
`golang:1.25.1-alpine3.22`. Образы PostgreSQL, Valkey, HAProxy и builder
закреплены digest/тегом.
```sh
# 1. Clone опубликованного fork
git clone --branch solution/bvt2301-melnikov \
https://gitea.privcloud.tech/MelnikStalker/mtusi2026lab3.git mtusi2026lab3
cd mtusi2026lab3
# 2. Локальные синтетические credentials (создаются в .env, mode 600, не коммитятся)
make env
# 3. Сборка, миграции отдельным one-shot сервисом, запуск LB на 127.0.0.1:8083
make up
# 4. Проверки
make check
make validate PYTHON=.venv/bin/python # .venv: requirements-dev.txt
make test # public smoke
make test-student # Go + 141 black-box
make test-failover ACTION_SCRIPT=scripts/stop-one.sh
make test-persistence ACTION_SCRIPT=scripts/restart.sh
# 5. Остановка с сохранением данных / удаление стенда / намеренное удаление volumes
make stop # контейнеры остановлены, volumes и данные сохранены
make down # контейнеры удалены, volumes сохранены
make purge # ЕДИНСТВЕННАЯ destructive-команда: удаляет volumes mtusi-lab3-melnikov-*
```
Порт LB по умолчанию `127.0.0.1:8083`; он задан в `.env.example` и
`Makefile` (`BASE_URL`), потому что 8080 занят работающим стендом lab2.
API-порты наружу не публикуются. Временные эксперименты track-1 используют
отдельную БД `messenger_track` (создаётся/удаляется скриптом); основной
`messenger` и volumes не затрагиваются.
## Архитектура и решения
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab2, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
```text
127.0.0.1:8083 (только loopback)
client ───────────────► HAProxy 3.0
│ roundrobin, активная проверка GET /health/ready
│ server-template + Docker DNS 127.0.0.11
├──────────► api-1 (свой X-Instance-Id, stateless)
├──────────► api-2
└──────────► api-N
│
┌────────────┴─────────────┐
▼ ▼
PostgreSQL 16.4 Valkey 8.0.2
users/chats/messages общие сессии, TTL,
+ message_idempotency AOF everysec, volume
```
- **Источник истины:** PostgreSQL для пользователей, чатов, членства,
сообщений и idempotency-записей; Valkey — единственное хранилище сессий.
Локальных сессий, очередей и файлов, от которых зависит корректность, в API
нет. Каждая реплика имеет только bounded pgx pool и HTTP-сервер.
- **`X-Instance-Id`:** равен hostname контейнера, стабилен всю жизнь
процесса. Это позволяет `scripts/stop-one.sh` сопоставить ответ ровно
одному контейнеру (`docker inspect .Config.Hostname`), а не угадывать по
префиксу. В lab3 hostname не запрещён; в lab7 он будет заменён непрозрачным
alias.
- **Сессии:** `POST /auth/sessions` (Basic) кладёт в Valkey SHA-256 токена и
absolute expiry; все реплики читают один ключ. TTL не продлевается
рестартом. AOF everysec — граница durability: graceful restart сохраняет
подтверждённые сессии, жёсткая потеря VM может потерять до 1 с.
- **Idempotency:** ключ обязателен только для `POST .../messages`; проверка
ASCII `[A-Za-z0-9._:-]{1,128}` до тела. Scope — `user_id + method +
path + key`. В одной SQL-инструкции CTE вставляет `messages` и
`message_idempotency`; уникальный конфликт откатывает всю инструкцию,
после чего читается победившая запись: тот же hash → исходный `201` и
`Message`, другой hash → `409`. Транзиентная ошибка не оставляет ни
сообщения, ни записи, поэтому retry безопасен. Retention — не менее 24 ч;
janitor удаляет только записи старше 24 ч (индекс по `created_at`).
- **LB и отказ:** HAProxy `server-template` перечитывает Docker DNS
(`hold valid 1s`), активная проверка `GET /health/ready` с `inter 1s`,
`fall 2`, `rise 1`; backend без двух подряд успешных проверок исключается
примерно за 2 с. `timeout connect 1s`, `server 15s`; `option redispatch`,
`retries 2`.
- **SIGTERM:** API сначала снимает readiness, затем 3 с продолжает
обслуживать запросы (drain), после чего `http.Server.Shutdown` с бюджетом
6 с и `stop_grace_period 15s`. LB успевает убрать backend до закрытия
соединений; в failover-матрице не было 5xx.
- **Миграции:** отдельный one-shot `migrate`; API его не запускает.
Advisory lock + checksum не дают гонке реплик и повторному применению.
`migrate` зависит от healthy PostgreSQL, API — от успешного завершения
`migrate`.
- **Ресурсы:** API не публикует порты, `read_only`, non-root uid 10001,
`cap_drop: ALL`, `no-new-privileges`; у всех сервисов CPU/RAM-лимиты.
Compose project/network/volumes — `mtusi-lab3-melnikov-*`; `container_name`
отсутствует, поэтому сервис масштабируется.
### Соответствие `.env.example`
| Переменная | Фактическое использование |
| --- | --- |
| `APP_HOST`, `APP_PORT` | адрес API внутри контейнера, 0.0.0.0:8080 |
| `APP_ENV`, `LOG_LEVEL` | окружение и уровень slog |
| `SESSION_TTL_SECONDS` | абсолютный TTL сессии в Valkey, default 3600 |
| `LB_PORT` | host-порт HAProxy, default 8083, только 127.0.0.1 |
| `API_REPLICAS` | `deploy.replicas` API (default 2) |
| `API_CPU_LIMIT`, `API_MEM_LIMIT` | cgroup CPU/RAM на одну API-реплику |
| `POSTGRES_*`, `VALKEY_*` | общие БД/сессии, пароли только в игнорируемом `.env` |
| `DB_MAX_CONNS`, `DB_*_TIMEOUT_SECONDS` | bounded pgx pool и таймауты |
| `CACHE_POOL_SIZE`, `CACHE_TIMEOUT_SECONDS` | pool и таймауты Valkey |
| `SHUTDOWN_TIMEOUT_SECONDS`, `SHUTDOWN_DRAIN_SECONDS` | graceful shutdown и drain |
| `GOMEMLIMIT` | мягкий лимит Go heap в контейнере |
| `GIT_REVISION` | build arg/ldflags, виден в логах и `/internal/stats` |
## Доказательства критериев
### Уровень 3
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
| --- | --- | --- | --- |
| Публичный smoke | make test | TODO | TODO |
| Остальные пункты уровня 3 | TODO | TODO | TODO |
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
| Весь стенд в compose, ≥2 API, один вход, общая БД и сессии | `make up`; `docker compose ps` | 2 API + PostgreSQL + Valkey + HAProxy; запуск одной командой | `evidence/container-checks.txt`, `evidence/public-smoke.txt` |
| Разные реплики обслуживают одну сессию без повторного входа | 30×`GET /users/me` с одним Bearer через LB | ≥2 разных `X-Instance-Id`, один user | `student-tests/blackbox.py` (`PASS instances`), `evidence/student-tests.txt` |
| Остановка любой одной реплики; чтение/запись ≤10 с; сообщения целы | `make test-failover ACTION_SCRIPT=scripts/stop-one.sh` | hook 3.4 с, 0 failed, первое восстановление 3.42 с, target исчез | `evidence/public-failover.txt`, `evidence/failover/each-replica.json` |
| Идемпотентность: повтор/конфликт/конкурентность/переключение реплики | public smoke + 16 параллельных POST с одним ключом | ровно один Message; replay равен исходному; другой body 409 | `evidence/public-smoke.txt`, `evidence/student-tests.txt` |
| `make test`, persistence и failover; ≥2 наблюдаемых реплики | `make test`, `make test-persistence`, `make test-failover` | PASS; 2 instance id | `evidence/public-smoke.txt`, `evidence/persistence.txt`, `evidence/public-failover.txt` |
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
### Уровень 4
## Эксперименты и отказы
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
| --- | --- | --- | --- |
| TODO | TODO | TODO | TODO |
| Health/readiness, timeouts, SIGTERM, исключение backend | `make test-container`; failover-матрица | readiness 200/503; drain 3 с; LB исключает backend за ~2 с; 0 ошибок | `evidence/container-checks.json`, `evidence/failover/each-replica.json` |
| Последовательно остановить каждую реплику, восстановить, собрать RPS/ошибки/recovery | `make failover-each` | 2 разных контейнера по очереди; 0 ошибок; first success 0.002–0.003 с, other replica 0.002–0.003 с; restore 0.612–1.594 с | `evidence/failover/each-replica.json` |
| CPU/RAM-лимиты; API не публикует порты; нет `container_name` | `make test-container` | API `docker port` пуст; LB только 127.0.0.1:8083; limits > 0; read-only/non-root | `evidence/container-checks.txt` |
| Rolling update под нагрузкой; миграции однократно и совместимы | `make rolling` | замена по одной, old/new version в ответах, 0 5xx, `migrate` no-op | `evidence/rolling-update/summary.json`, `evidence/rolling-update/migrate.txt` |
## Ограничения и следующие шаги
### Уровень 5, трек 1
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
| --- | --- | --- | --- |
| Гипотеза и воспроизводимая методика | `python3 scripts/track1.py` | 3 серии, фиксированные лимиты, сырые JSON и timestamps | `evidence/track1/methodology.md` |
| 1/2/4 реплики при фиксированном суммарном CPU/RAM | fixed_total | медианы RPS и latency, DB у предела | `evidence/track1/summary.json`, `evidence/track1/plots/fixed-rps.svg` |
| Серия с ростом ресурсов | resource_growth | RPS растёт до насыщения DB | `evidence/track1/plots/growth-rps.svg` |
| Saturation point БД/LB/пула и почему реплики перестают помогать | cgroup + pg_stat + HAProxy + pgx stats | DB ~0.67–0.69/0.70 и throttling; LB ~0.10/0.20; pool waits падают с ростом реплик, но DB ограничивает | `evidence/track1/summary.json`, `evidence/track1/plots/saturation.svg` |
| Одно подтверждённое улучшение | baseline vs optimized image, 4×0.2 | +46.9 RPS при тех же лимитах | `evidence/track1/plots/improvement-rps.svg`, `evidence/track1/runs/` |
| Сырые данные, графики, ограничения | — | JSON каждого прогона + SVG + раздел ограничений | `evidence/track1/raw/`, `evidence/track1/plots/` |
## Эксперименты
### Стенд и профиль
- macOS arm64, Colima 0.8.1, Docker Engine 27.4.0, Compose 2.37.0;
**Docker VM: 2 vCPU, 2 GiB RAM**. Все API, PostgreSQL, Valkey и HAProxy —
контейнеры на одном kernel и одном Docker-host; это не независимые узлы.
- Профиль: closed-loop `POST /api/v1/chats/{id}/messages` через LB, 32 Go-
воркера, уникальный `Idempotency-Key` и текст на запрос, 5 с warmup,
20 с измерение, 3 чередующихся прогона на конфигурацию. RPS — HTTP 2xx
acknowledgements, не число COMMIT; latency — только успешные запросы.
- Перед каждым прогоном track-1 удаляется и заново мигрируется отдельная БД
`messenger_track`; каждый стартует с 0 сообщений, чтобы 20 минут
накопленных данных не искажали сравнение. Основная БД `messenger` не
затрагивается.
- Лимиты: PostgreSQL 0.70 vCPU/512 MiB, Valkey 0.10/128 MiB,
HAProxy 0.20/64 MiB; API суммарно 0.8 vCPU/512 MiB в fixed-серии.
Сумма CPU-лимитов 1.8 (fixed) и 1.9 (growth) из 2 vCPU VM.
### Fixed total: 1/2/4 реплики
| Реплики | RPS median (min–max) | p50 / p95 / p99, ms | Ошибки | API cores / limit | DB cores / limit | DB util | DB throttled, s | Pool waits/acquire | LB cores / 0.2 | LB 5xx |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | 1228.8 (994.7–1601.6) | 20.6 / 60.4 / 90.7 | 0.0000 | 0.351 / 0.80 | 0.672 / 0.70 | 0.960 | 2.38 | 0.997 | 0.093 | 0 |
| 2 | 1542.0 (1048.6–1601.7) | 17.5 / 43.7 / 80.1 | 0.0000 | 0.413 / 0.80 | 0.685 / 0.70 | 0.978 | 3.74 | 0.900 | 0.092 | 0 |
| 4 | 1585.9 (1174.4–1623.1) | 17.1 / 41.6 / 66.0 | 0.0000 | 0.473 / 0.80 | 0.687 / 0.70 | 0.982 | 3.47 | 0.159 | 0.089 | 0 |
### Рост ресурсов при 4 репликах
| API всего, vCPU | На реплику | RPS median (min–max) | p95, ms | API util | DB util | DB throttled, s | Pool waits/acquire | Сообщений за прогон | Commits/s |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 0.4 | 0.100 | 1534.2 (1107.2–1540.7) | 56.8 | 0.988 | 0.859 | 1.09 | 0.302 | 39225 | 4523 |
| 0.7 | 0.175 | 1293.4 (681.7–1337.6) | 57.8 | 0.679 | 0.960 | 3.04 | 0.162 | 31405 | 3597 |
| 0.9 | 0.225 | 1547.4 (773.7–1727.2) | 45.5 | 0.521 | 0.983 | 3.53 | 0.158 | 38817 | 4538 |
### Подтверждённое улучшение
Baseline image `sha256:96a80886…` (явная транзакция + отдельные INSERT сообщения и idempotency) и optimized image `sha256:c999351d…` (один атомарный CTE) проверены в чередующихся прогонах при одинаковых 4×0.2 vCPU / 128 MiB и одинаковой БД. Пары дали +96.1%, +48.3% и +9.1%; медиана +46.9%. В optimized меньше SQL-инструкций и сетевых round-trip на сообщение, поэтому при том же потолке PostgreSQL (~0.997–0.998 utilization) он подтверждает больше записей; p95 снижается с 39.4 до 30.9 мс. Разброс по парам — следствие прогрева 2-vCPU VM, поэтому ниже приведены и медианы, и сырые пары.
| Образ | RPS median (min–max) | p50 / p95 / p99, ms | DB util | API cores / 0.8 | Commits/s | Сообщений за прогон | Image id |
| --- | --- | --- | --- | --- | --- | --- | --- |
| baseline | 1630.1 (1022.2–2196.2) | 17.0 / 39.4 / 50.7 | 0.9963 | 0.519 | 4783 | 41222 | `sha256:96a8088665da861fa43e27196f1da24b0b99fc6b6e6e7daad6fb6b8b0b3d15fc` |
| optimized | 2395.1 (2004.3–2417.2) | 11.1 / 30.9 / 39.2 | 0.9978 | 0.454 | 6721 | 58167 | `sha256:c999351dd1ef2d2199d0bfeb73f057d80cee077afef267e97c3de9a10ef7ed48` |
| Пара | baseline RPS | optimized RPS | Прирост | baseline p95 | optimized p95 |
| --- | --- | --- | --- | --- | --- |
| 1 | 1022.2 | 2004.3 | +96.1% | 78.5 | 33.7 |
| 2 | 1630.1 | 2417.2 | +48.3% | 39.4 | 30.2 |
| 3 | 2196.2 | 2395.1 | +9.1% | 31.4 | 30.9 |
### Точка насыщения и объяснение
При фиксированном суммарном бюджете API 0.8 vCPU медианы: 1 реплика — 1229 RPS, 2 — 1542 RPS (+25.5%), 4 — 1586 RPS (+2.8% ко второй). Причина видна по компонентам: на одной реплике 8 соединений pgx-пула дают **99.7%** acquire-wait, при двух — 90.0%, при четырёх — 15.9%; но CPU PostgreSQL уже занимает **0.672 / 0.685 / 0.687 из 0.70** (96.0 / 97.8 / 98.2%), в окне 25 с набегает 2.38 / 3.74 / 3.47 с throttling и 147–197 throttle-периодов. В выборках активных соединений доминируют `LWLock:WALWrite`/`LWLock:BufferContent`, то есть общий commit/WAL-путь, а не HTTP. HAProxy использует 0.093 / 0.092 / 0.089 из 0.20 vCPU, очередь `qmax=0`, 5xx=0 — LB не насыщен. API использует лишь 0.35–0.47 из 0.80 vCPU; он не является ограничителем на 2–4 репликах.
Серия роста 4 реплик 0.4→0.7→0.9 vCPU не даёт монотонного роста RPS: медианы 1534→1293→1547, а диапазоны прогонов перекрываются (1107–1541, 682–1338, 774–1727). При этом DB utilization растёт 0.859→0.960→0.983, а API utilization на 0.4 уже 98.8% и 34 с throttling за окно. Это и есть saturation point: **общая PostgreSQL (commit/WAL + CPU-квота)**. Дополнительные API-реплики и CPU после ~0.4 vCPU не увеличивают подтверждённую пропускную способность; они лишь создают больше конкурирующих DB-сессий. Абсолютные различия 0.4/0.7/0.9 частично объясняются шумом одной 2-vCPU Colima VM; это ограничение зафиксировано, а не замаскировано.
### Отказы
| Воздействие | Что ожидали | Что наблюдали | Восстановление / потеря |
| --- | --- | --- | --- |
| Остановка каждой API-реплики по очереди под нагрузкой | другие реплики продолжают, краткие ошибки допустимы | два разных контейнера `api-1`/`api-2` (container ids `a5e18417…`, `ddf2f672…`; instance ids совпадают с hostname); 0 ошибок в каждом 16-секундном mixed-прогоне; target исчез из ответов | первый успешный запрос через другую реплику — 0.002/0.003 с; первая запись — 0.002/0.207 с; target_responses_after_stop=0; остановка контейнера 3.22/3.32 с; восстановление до обслуживания LB — 1.594/0.612 с |
| `docker stop` PostgreSQL | live 200, ready 503, защищённые 503, аноним 401; данные/токен целы | прямо в процессе API: live 200, ready 503, защищённый/логин/запись 503; через LB live 200 (на момент замера backend ещё не исключён), ready 503 | 5.411 с до readiness через LB; volumes сохранены; тот же токен работает, история читается |
| `docker stop` Valkey | live 200, ready 503, защищённые 503, аноним 401; токен цел | прямо в процессе API: live 200, ready 503, защищённый/логин/запись 503; через LB live и ready 503 после исключения backend | 5.385 с до readiness; volumes и counts сохранены; тот же токен работает |
| Rolling update 1.0.0 → 2.0.0 под нагрузкой | поочерёдная замена, старые и новые реплики совместимы | две старые реплики заменены по одной; probe: 183 848 запросов, 0 ошибок, 3676.8 RPS, p95 4.3 мс; в ответах 32 821 × 1.0.0 и 151 027 × 2.0.0; 4 разных instance id (старые и новые) | без потери запросов; повторный migrate — no-op 3.709 мс при работающих старых репликах, схема 1,2,3 до/после; финальные контейнеры на image `sha256:7b7cf471…` |
| Перезапуск API и всех stores с сохранением volumes | прежний токен и данные | `make test-persistence` PASS | `evidence/persistence.txt` |
## Исправленные по ходу дефекты
- В исходном переносе lab2 счётчик миграций в `TestLoadMigrations` ожидал 2;
после добавления lab3-миграции обновлён до 3 и расширен тест обязательных
объектов.
- Compose-масштабирование `--force-recreate` после предыдущего scale-down
оставляло лишние API-контейнеры; эксперимент и failover теперь явно
удаляют контейнеры сервиса перед созданием ровно N реплик. Это дефект
стенда/скриптов, а не API; после исправления проверено 1/2/4.
- HAProxy с per-request access log упирался в CPU-лимит раньше БД; для
измерения именно LB добавлен `option dontlog-normal` (ошибки логируются).
Это изменение конфигурации LB, а не ослабление проверок.
- Первая версия track-1 сравнивала конфигурации на растущей БД и холодном
кеше; введена отдельная `messenger_track`, пересоздаваемая перед каждым
прогоном. Сырые данные ранних диагностических прогонов не выдаются за
финальные.
- `pgxpool.Stat` и cgroup-метрики разведены: `empty_acquire_count` — ожидание
connection pool, cgroup `throttled_usec` — CPU throttling, `memory.current`
— cgroup working set, не RSS. В отчёте единицы указаны явно.
- Python-скрипты не используют `Thread._stop`/`Event` в имени атрибута:
sampler останавливается локальным `threading.Event` через `wait`, без
monkey-patching внутреннего `Thread._stop`.
## Чистый clone
Проверено на отдельном clone commit `1a7f31e7e5ee25e5f34b7b851d068c5cce77ed43`
(код приложения совпадает с `922a38b…`, отличаются только скрипты/отчёт) в
`/Users/ivanmuller/Desktop/oh_my_life/.local/highload-tasks/lab3-artifacts/`.
До тестов: `users=0`, `migrations=1,2,3` — схема поднята с нуля на пустых
volumes. `make check`, `make validate`, `make test`, 141 black-box проверка
на Python 3.9.6 и `make test-persistence` — PASS; persistence сохранил
прежний токен. После проверки `make purge` удалил контейнеры, volumes, сеть
и временный image, контейнеров/volumes проекта не осталось. Основной стенд
на время проверки был остановлен с сохранением данных и затем поднят с теми
же volumes.
Первый запуск clean clone в `/tmp` выявил ограничение Colima: VM не
bind-mount-ит `/tmp`, поэтому `infra/haproxy.cfg` внутри контейнера оказался
пустым. Это ограничение окружения, а не приложения; clone перенесён в
разделяемый путь `/Users/...`, после чего проверка прошла. Для сдачи
достаточно клонировать в домашний каталог.
## Защита
1. `make up`; 30 запросов `GET /api/v1/users/me` с одним токеном через
`http://127.0.0.1:8083` показывают ≥2 `X-Instance-Id`.
2. `make test-failover ACTION_SCRIPT=scripts/stop-one.sh`: тест сам выбирает
реплику, скрипт останавливает именно её контейнер и оставляет остановленной;
затем `docker inspect` показывает `exited` у этого контейнера и `running`
у другой реплики.
3. Восстановить: `docker start <container-id>`; повторить для второй реплики
(`make failover-each` делает это автоматически).
4. `make test-persistence ACTION_SCRIPT=scripts/restart.sh` — прежний токен
работает после restart PostgreSQL/Valkey/API.
5. `make rolling` — замена образа по одной реплике под нагрузкой; в ответах
видны `X-App-Version: 1.0.0` и `2.0.0`.
6. `python3 scripts/track1.py` — графики и summary; при защите объяснить
разницу между отказом процесса и отказом узла, почему depends_on/
healthcheck не LB, какие POST можно повторять, что сломается при
локальных сессиях.
## Ограничения
- Один Docker-host и один экземпляр PostgreSQL/Valkey/HAProxy: проверен отказ
**процесса API**, но не отказ узла, БД, LB или Docker-host. Это не HA
уровня production.
- PostgreSQL не реплицирован; потеря его volume/узла означает потерю данных.
WAL archiving/PITR не входят в lab3.
- Сессии в Valkey AOF everysec: жёсткая потеря VM может потерять до 1 с
сессионных записей; graceful restart сохраняет всё. TTL абсолютный.
- Абсолютные RPS/латентности — локальные для Colima 2 vCPU/2 GiB и не SLA.
Closed-loop нагрузка страдает coordinated omission; ошибки считаются
отдельно, latency — только успешные запросы.
- Rolling update проверяет замену образа при **неизменной** схеме: повторный
`migrate` — no-op. Аддитивная миграция `0003` совместима со старыми
репликами, но destructive/долгая миграция под нагрузкой не проверялась;
это ограничение описано честно.
- `Idempotency-Key` хранится дольше 24 ч; janitor удаляет только записи
старше 24 ч раз в час/на старте. Таблица растёт при интенсивной записи;
retention-политика не претендует на production-очистку.
- `X-Instance-Id` в lab3 — hostname контейнера (удобно для stop-one); в lab7
требуется непрозрачный alias, это отдельное изменение.
- Python 3.9.6 проверен для публичных и собственных HTTP-тестов; скрипты
эксперимента используют только stdlib. Go-тесты выполнялись Go 1.25.1.
- Fork и push выполнены по поручению пользователя; MR открыт как заявка на
проверку, а не слияние и не подтверждение оценки.
## Формат сдачи
- Ветка: `solution/bvt2301-melnikov` от `main` ревизии
`0ab3a341aa7ba32363ce43061d4ff02b1f2964af`.
- Опубликованный fork: https://gitea.privcloud.tech/MelnikStalker/mtusi2026lab3;
MR открыт в `mtusi2026/mtusi2026lab3` из этой ветки в `main`.
- Ветка содержит реализацию, `compose.yaml`, `infra/haproxy.cfg`, `cmd/`,
`internal/`, миграции, `student-tests/`, `scripts/`, `REPORT.md`, `MR.md`,
`evidence/`.
- Публичные `tests/`, `contracts/`, `README.md`, `COURSE.md`,
`CONTRIBUTING.md`, `lab.json` не изменялись.
- Принятый commit решения — `a339f65ed0081e41882e21bc0392b254558265c1`;
публикационные docs-правки идут отдельным коммитом поверх него, точный
опубликованный HEAD — вершина ветки.
+700
View File
@@ -0,0 +1,700 @@
// Command loadgen is a synthetic HTTP load generator for the lab3 experiment.
// It is not part of the public API contract. It creates its own synthetic user
// and chat through the load balancer, then measures message POST throughput
// (or a mixed read/write profile) with per-second buckets and X-Instance-Id
// attribution.
//
// The default profile is closed-loop: `-concurrency` workers each send the
// next request as soon as the previous one finishes. `-rate` switches to an
// open-loop target rate. Both are reported honestly as HTTP acknowledgement
// throughput, not as a count of PostgreSQL commits.
package main
import (
"bytes"
"context"
"crypto/rand"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
"io"
"math"
"net/http"
"os"
"os/exec"
"sort"
"sync"
"sync/atomic"
"time"
)
var version = "dev"
type config struct {
baseURL string
duration time.Duration
warmup time.Duration
concurrency int
rate float64
readRatio float64
timeout time.Duration
output string
retryUncertain bool
note string
stopInstance string
stopScript string
stopAfter time.Duration
}
type seriesBucket struct {
Second int64 `json:"second"`
Success int64 `json:"success"`
Errors int64 `json:"errors"`
P50 float64 `json:"p50_ms"`
P95 float64 `json:"p95_ms"`
P99 float64 `json:"p99_ms"`
latency []float64
}
type summary struct {
Tool string `json:"tool"`
Version string `json:"version"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at"`
MeasuredSeconds float64 `json:"measured_seconds"`
WarmupSeconds float64 `json:"warmup_seconds"`
Concurrency int `json:"concurrency"`
RateLimit float64 `json:"rate_limit_per_second"`
ReadRatio float64 `json:"read_ratio"`
RetryUncertain bool `json:"retry_uncertain"`
Profile string `json:"profile"`
Successful int64 `json:"successful_requests"`
Failed int64 `json:"failed_requests"`
ErrorRatio float64 `json:"error_ratio"`
SuccessfulRPS float64 `json:"successful_rps"`
OfferedRPS float64 `json:"offered_rps"`
LatencyMS latencySummary `json:"successful_latency_ms"`
StatusCounts map[string]int64 `json:"status_counts"`
Instances map[string]int64 `json:"instances"`
AppVersions map[string]int64 `json:"app_versions"`
Kinds map[string]int64 `json:"kinds"`
Series []seriesBucket `json:"series"`
Retries int64 `json:"uncertain_retries"`
Violations []string `json:"idempotency_violations,omitempty"`
Note string `json:"note"`
Failover *failoverSummary `json:"failover,omitempty"`
}
type failoverSummary struct {
TargetInstance string `json:"target_instance"`
StopStartedAt string `json:"stop_started_at"`
StopFinishedAt string `json:"stop_finished_at"`
StopScriptExit int `json:"stop_script_exit"`
StopDurationSeconds float64 `json:"stop_duration_seconds"`
FirstSuccessAfterStopSec float64 `json:"first_success_after_stop_seconds"`
FirstWriteAfterStopSec float64 `json:"first_write_after_stop_seconds"`
FirstOtherSuccessSec float64 `json:"first_success_on_other_replica_seconds"`
SuccessesAfterStop int64 `json:"successes_after_stop"`
OtherSuccessesAfterStop int64 `json:"successes_on_other_replica_after_stop"`
ErrorsAfterStop int64 `json:"errors_after_stop"`
TargetResponsesAfterStop int64 `json:"target_responses_after_stop"`
TargetLastResponseAt string `json:"target_last_response_at"`
}
type latencySummary struct {
P50 float64 `json:"p50"`
P95 float64 `json:"p95"`
P99 float64 `json:"p99"`
Max float64 `json:"max"`
Mean float64 `json:"mean"`
}
func main() {
cfg := config{}
flag.StringVar(&cfg.baseURL, "base-url", "http://127.0.0.1:8083", "LB base URL")
flag.DurationVar(&cfg.duration, "duration", 20*time.Second, "measured duration")
flag.DurationVar(&cfg.warmup, "warmup", 5*time.Second, "warmup before measurement")
flag.IntVar(&cfg.concurrency, "concurrency", 32, "workers (closed loop) or max in-flight (rate mode)")
flag.Float64Var(&cfg.rate, "rate", 0, "open-loop target requests/second; 0 = closed loop")
flag.Float64Var(&cfg.readRatio, "read-ratio", 0, "fraction of GET /users/me requests (failover probe)")
flag.DurationVar(&cfg.timeout, "timeout", 5*time.Second, "per-request timeout")
flag.StringVar(&cfg.output, "output", "", "write JSON summary to this path")
flag.BoolVar(&cfg.retryUncertain, "retry-uncertain", false, "retry failed POSTs with the same Idempotency-Key (failover probe)")
flag.StringVar(&cfg.note, "note", "", "free-form note stored in the summary")
flag.StringVar(&cfg.stopInstance, "stop-instance", "", "failover probe: stop this X-Instance-Id during the run")
flag.StringVar(&cfg.stopScript, "stop-script", "", "failover probe: executable that stops TARGET_INSTANCE_ID")
flag.DurationVar(&cfg.stopAfter, "stop-after", 0, "failover probe: stop after this much measured time")
flag.StringVar(&version, "version", "dev", "generator revision label")
flag.Parse()
if cfg.duration <= 0 || cfg.concurrency < 1 || cfg.readRatio < 0 || cfg.readRatio > 1 || cfg.rate < 0 {
fmt.Fprintln(os.Stderr, "invalid load parameters")
os.Exit(2)
}
client := &http.Client{
Timeout: cfg.timeout,
Transport: &http.Transport{
MaxIdleConns: cfg.concurrency*2 + 8,
MaxIdleConnsPerHost: cfg.concurrency*2 + 8,
IdleConnTimeout: 30 * time.Second,
DisableCompression: true,
},
}
actor, chat := bootstrap(client, cfg.baseURL)
runID := randomHex(8)
measureStart := time.Now().Add(cfg.warmup)
deadline := measureStart.Add(cfg.duration)
var failover *failoverState
if cfg.stopScript != "" {
target := cfg.stopInstance
if target == "" {
target = observeAnyInstance(client, cfg.baseURL, actor)
}
if target == "" {
fail("no X-Instance-Id observed for failover target")
}
failover = &failoverState{target: target, script: cfg.stopScript}
go failover.run(measureStart.Add(cfg.stopAfter))
}
var (
mu sync.Mutex
samples []result
series = map[int64]*seriesBucket{}
retries int64
)
worker := func(id int) {
seq := 0
for {
now := time.Now()
if !now.Before(deadline) {
return
}
// Warmup traffic is sent but excluded from every summary number.
measured := !now.Before(measureStart)
kind := "write"
if cfg.readRatio > 0 && float64((id+seq)%1000)/1000.0 < cfg.readRatio {
kind = "read"
}
start := time.Now()
result := oneRequest(client, cfg.baseURL, actor, chat, kind, fmt.Sprintf("%s-%d-%d", runID, id, seq), cfg.retryUncertain)
elapsed := time.Since(start)
seq++
if !measured {
continue
}
result.at = start
result.done = time.Now()
result.latency = elapsed
mu.Lock()
samples = append(samples, result)
if result.err != "" && result.ok {
retries++
}
bucket := series[start.Unix()]
if bucket == nil {
bucket = &seriesBucket{Second: start.Unix()}
series[start.Unix()] = bucket
}
if result.ok {
bucket.Success++
bucket.latency = append(bucket.latency, float64(result.latency.Microseconds())/1000.0)
} else {
bucket.Errors++
}
mu.Unlock()
if cfg.rate > 0 {
// Spread a fixed offered rate across workers. This is a
// best-effort pacing, not a hard scheduler; lateness is
// visible in the latency distribution.
interval := time.Duration(float64(time.Second) * float64(cfg.concurrency) / cfg.rate)
if sleep := interval - time.Since(start); sleep > 0 {
time.Sleep(sleep)
}
}
}
}
var wg sync.WaitGroup
for i := 0; i < cfg.concurrency; i++ {
wg.Add(1)
go func(id int) {
defer wg.Done()
worker(id)
}(i)
}
wg.Wait()
finished := time.Now()
measuredSeconds := finished.Sub(measureStart).Seconds()
var failoverSnapshot *failoverState
if failover != nil {
failoverSnapshot = failover
}
sum := summarize(cfg, runID, measureStart, finished, measuredSeconds, samples, series, atomic.LoadInt64(&retries), failoverSnapshot)
if cfg.output != "" {
data, _ := json.MarshalIndent(sum, "", " ")
if err := os.WriteFile(cfg.output, append(data, '\n'), 0o644); err != nil {
fmt.Fprintln(os.Stderr, "cannot write output:", err)
os.Exit(1)
}
}
encoded, _ := json.MarshalIndent(sum, "", " ")
fmt.Println(string(encoded))
if sum.Successful == 0 {
os.Exit(1)
}
}
type credentials struct {
token string
user string
}
type chatInfo struct {
id string
}
type result struct {
at time.Time
done time.Time
latency time.Duration
ok bool
status int
instance string
appVer string
kind string
key string
message string
err string
}
func oneRequest(client *http.Client, base string, actor credentials, chat chatInfo, kind, key string, retry bool) result {
deadline := time.Now().Add(10 * time.Second)
for {
res := requestOnce(client, base, actor, chat, kind, key)
if res.ok || !retry || kind != "write" || time.Now().After(deadline) {
return res
}
// A timeout or LB 502/503 after SIGTERM is an uncertain result. The
// same key is safe to retry only because the server's idempotency
// record and message are committed atomically.
res.err = "retry:" + res.err
time.Sleep(30 * time.Millisecond)
}
}
func requestOnce(client *http.Client, base string, actor credentials, chat chatInfo, kind, key string) result {
method, path := http.MethodPost, "/api/v1/chats/"+chat.id+"/messages"
var body io.Reader
if kind == "read" {
method, path = http.MethodGet, "/api/v1/users/me"
} else {
payload, _ := json.Marshal(map[string]string{"text": "load " + key})
body = bytes.NewReader(payload)
}
req, err := http.NewRequestWithContext(context.Background(), method, base+path, body)
if err != nil {
return result{status: 0, err: "build_request"}
}
req.Header.Set("Authorization", "Bearer "+actor.token)
if kind == "write" {
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", key)
}
response, err := client.Do(req)
if err != nil {
return result{status: 0, err: "transport"}
}
defer response.Body.Close()
data, readErr := io.ReadAll(io.LimitReader(response.Body, 1<<20))
res := result{
status: response.StatusCode,
instance: response.Header.Get("X-Instance-Id"),
appVer: response.Header.Get("X-App-Version"),
kind: kind,
key: key,
}
if readErr != nil {
res.err = "read_body"
return res
}
if response.StatusCode == http.StatusCreated || response.StatusCode == http.StatusOK {
res.ok = true
if kind == "write" {
var message struct {
ID string `json:"id"`
}
if err := json.Unmarshal(data, &message); err != nil || message.ID == "" {
res.ok = false
res.err = "bad_json"
} else {
res.message = message.ID
}
}
return res
}
res.err = "status"
return res
}
func bootstrap(client *http.Client, base string) (credentials, chatInfo) {
// /health/ready is retried until the stack is up.
waitReady(client, base)
username := "lg_" + randomHex(10)
password := "Loadgen-" + randomHex(12)
registered := struct {
ID string `json:"id"`
}{}
postJSON(client, base+"/api/v1/users", "", map[string]string{
"username": username, "display_name": "Load generator", "password": password,
}, &registered)
basic := basicAuth(username, password)
session := struct {
Token string `json:"token"`
}{}
postJSON(client, base+"/api/v1/auth/sessions", "Basic "+basic, nil, &session)
if session.Token == "" || registered.ID == "" {
fail("bootstrap failed")
}
chat := struct {
ID string `json:"id"`
}{}
postJSON(client, base+"/api/v1/chats", "Bearer "+session.Token, map[string]interface{}{
"title": "loadgen " + randomHex(6), "member_ids": []string{registered.ID},
}, &chat)
if chat.ID == "" {
fail("chat bootstrap failed")
}
return credentials{token: session.Token, user: registered.ID}, chatInfo{id: chat.ID}
}
func waitReady(client *http.Client, base string) {
deadline := time.Now().Add(90 * time.Second)
for time.Now().Before(deadline) {
response, err := client.Get(base + "/health/ready")
if err == nil {
io.Copy(io.Discard, response.Body)
response.Body.Close()
if response.StatusCode == http.StatusOK {
return
}
}
time.Sleep(250 * time.Millisecond)
}
fail("stack did not become ready")
}
func postJSON(client *http.Client, url, authorization string, body interface{}, out interface{}) {
var reader io.Reader
if body != nil {
data, _ := json.Marshal(body)
reader = bytes.NewReader(data)
}
req, err := http.NewRequest(http.MethodPost, url, reader)
if err != nil {
fail("build bootstrap request")
}
if body != nil {
req.Header.Set("Content-Type", "application/json")
}
if authorization != "" {
req.Header.Set("Authorization", authorization)
}
response, err := client.Do(req)
if err != nil {
fail("bootstrap transport failure")
}
defer response.Body.Close()
data, _ := io.ReadAll(io.LimitReader(response.Body, 1<<20))
if response.StatusCode != http.StatusCreated {
fail(fmt.Sprintf("bootstrap status %d", response.StatusCode))
}
if out != nil {
if err := json.Unmarshal(data, out); err != nil {
fail("bootstrap JSON")
}
}
}
func basicAuth(username, password string) string {
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
raw := []byte(username + ":" + password)
var encoded []byte
for i := 0; i < len(raw); i += 3 {
var chunk [3]byte
n := copy(chunk[:], raw[i:])
value := uint(chunk[0])<<16 | uint(chunk[1])<<8 | uint(chunk[2])
encoded = append(encoded, alphabet[value>>18&63], alphabet[value>>12&63])
if n > 1 {
encoded = append(encoded, alphabet[value>>6&63])
} else {
encoded = append(encoded, '=')
}
if n > 2 {
encoded = append(encoded, alphabet[value&63])
} else {
encoded = append(encoded, '=')
}
}
return string(encoded)
}
func summarize(cfg config, runID string, start, finished time.Time, seconds float64, samples []result, series map[int64]*seriesBucket, retries int64, failover *failoverState) summary {
sum := summary{
Tool: "mtusi-lab3-loadgen",
Version: version,
StartedAt: start.UTC().Format(time.RFC3339Nano),
FinishedAt: finished.UTC().Format(time.RFC3339Nano),
MeasuredSeconds: round(seconds, 3),
WarmupSeconds: cfg.warmup.Seconds(),
Concurrency: cfg.concurrency,
RateLimit: cfg.rate,
ReadRatio: cfg.readRatio,
RetryUncertain: cfg.retryUncertain,
Profile: "closed-loop",
StatusCounts: map[string]int64{},
Instances: map[string]int64{},
AppVersions: map[string]int64{},
Kinds: map[string]int64{},
Retries: retries,
Note: cfg.note,
}
if cfg.rate > 0 {
sum.Profile = fmt.Sprintf("open-loop target %.1f req/s (best effort)", cfg.rate)
}
sum.Note = cfg.note + "; synthetic messages created by loadgen, no retries unless -retry-uncertain"
var latencies []float64
idByKey := map[string]string{}
summaryFailover := buildFailoverSummary(failover, samples)
for _, item := range samples {
sum.Kinds[item.kind]++
statusKey := fmt.Sprintf("%d", item.status)
if item.status == 0 {
statusKey = "error:" + item.err
}
sum.StatusCounts[statusKey]++
if item.ok {
sum.Successful++
latencies = append(latencies, float64(item.latency.Microseconds())/1000.0)
if item.instance == "" {
item.instance = "(missing)"
}
sum.Instances[item.instance]++
ver := item.appVer
if ver == "" {
ver = "(missing)"
}
sum.AppVersions[ver]++
if item.kind == "write" && item.message != "" {
if previous, seen := idByKey[item.key]; seen && previous != item.message {
sum.Violations = append(sum.Violations, "same key returned different message ids")
}
idByKey[item.key] = item.message
}
} else {
sum.Failed++
}
}
sum.OfferedRPS = round(float64(sum.Successful+sum.Failed)/seconds, 3)
sum.SuccessfulRPS = round(float64(sum.Successful)/seconds, 3)
if total := sum.Successful + sum.Failed; total > 0 {
sum.ErrorRatio = round(float64(sum.Failed)/float64(total), 6)
}
sort.Float64s(latencies)
sum.LatencyMS = latencyPercentiles(latencies)
sum.Failover = summaryFailover
keys := make([]int64, 0, len(series))
for second := range series {
keys = append(keys, second)
}
sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
for _, second := range keys {
bucket := series[second]
sort.Float64s(bucket.latency)
bucket.P50 = percentile(bucket.latency, 0.50)
bucket.P95 = percentile(bucket.latency, 0.95)
bucket.P99 = percentile(bucket.latency, 0.99)
sum.Series = append(sum.Series, *bucket)
}
return sum
}
func percentile(sorted []float64, p float64) float64 {
if len(sorted) == 0 {
return 0
}
index := int(math.Ceil(p*float64(len(sorted)))) - 1
if index < 0 {
index = 0
}
if index >= len(sorted) {
index = len(sorted) - 1
}
return round(sorted[index], 3)
}
func latencyPercentiles(sorted []float64) latencySummary {
if len(sorted) == 0 {
return latencySummary{}
}
pick := func(p float64) float64 { return percentile(sorted, p) }
var total float64
for _, value := range sorted {
total += value
}
return latencySummary{
P50: pick(0.50), P95: pick(0.95), P99: pick(0.99),
Max: round(sorted[len(sorted)-1], 3), Mean: round(total/float64(len(sorted)), 3),
}
}
func round(value float64, digits int) float64 {
scale := math.Pow(10, float64(digits))
return math.Round(value*scale) / scale
}
func randomHex(n int) string {
buf := make([]byte, n)
if _, err := rand.Read(buf); err != nil {
fail("random")
}
return hex.EncodeToString(buf)
}
func fail(message string) {
fmt.Fprintln(os.Stderr, "loadgen:", message)
os.Exit(2)
}
type failoverState struct {
target string
script string
mu sync.Mutex
started time.Time
finished time.Time
exitCode int
err string
}
func (f *failoverState) run(at time.Time) {
if delay := time.Until(at); delay > 0 {
time.Sleep(delay)
}
f.mu.Lock()
f.started = time.Now()
f.mu.Unlock()
command := exec.Command(f.script)
command.Env = append(os.Environ(), "TARGET_INSTANCE_ID="+f.target)
command.Stdout = io.Discard
command.Stderr = io.Discard
err := command.Run()
f.mu.Lock()
defer f.mu.Unlock()
f.finished = time.Now()
if err == nil {
f.exitCode = 0
return
}
if exitError, ok := err.(*exec.ExitError); ok {
f.exitCode = exitError.ExitCode()
} else {
f.exitCode = -1
f.err = err.Error()
}
}
func (f *failoverState) snapshot() failoverState {
f.mu.Lock()
defer f.mu.Unlock()
return failoverState{
target: f.target,
started: f.started,
finished: f.finished,
exitCode: f.exitCode,
err: f.err,
}
}
func observeAnyInstance(client *http.Client, base string, actor credentials) string {
deadline := time.Now().Add(30 * time.Second)
for time.Now().Before(deadline) {
req, _ := http.NewRequest(http.MethodGet, base+"/api/v1/users/me", nil)
req.Header.Set("Authorization", "Bearer "+actor.token)
response, err := client.Do(req)
if err == nil {
io.Copy(io.Discard, response.Body)
response.Body.Close()
if instance := response.Header.Get("X-Instance-Id"); instance != "" {
return instance
}
}
time.Sleep(100 * time.Millisecond)
}
return ""
}
func buildFailoverSummary(failover *failoverState, samples []result) *failoverSummary {
if failover == nil {
return nil
}
state := failover.snapshot()
if state.started.IsZero() {
return nil
}
summary := &failoverSummary{
TargetInstance: state.target,
StopStartedAt: state.started.UTC().Format(time.RFC3339Nano),
StopFinishedAt: state.finished.UTC().Format(time.RFC3339Nano),
StopScriptExit: state.exitCode,
StopDurationSeconds: round(state.finished.Sub(state.started).Seconds(), 3),
FirstSuccessAfterStopSec: -1,
FirstWriteAfterStopSec: -1,
FirstOtherSuccessSec: -1,
}
var firstSuccess, firstWrite, firstOther time.Time
var lastTarget time.Time
for _, item := range samples {
if item.instance == state.target && item.done.After(lastTarget) {
lastTarget = item.done
}
if !item.at.After(state.started) {
continue
}
if item.ok {
summary.SuccessesAfterStop++
if firstSuccess.IsZero() || item.done.Before(firstSuccess) {
firstSuccess = item.done
}
if item.kind == "write" && (firstWrite.IsZero() || item.done.Before(firstWrite)) {
firstWrite = item.done
}
if item.instance != state.target {
summary.OtherSuccessesAfterStop++
if firstOther.IsZero() || item.done.Before(firstOther) {
firstOther = item.done
}
}
} else {
summary.ErrorsAfterStop++
}
if item.at.After(state.finished.Add(500*time.Millisecond)) && item.instance == state.target {
summary.TargetResponsesAfterStop++
}
}
if !firstSuccess.IsZero() {
summary.FirstSuccessAfterStopSec = round(firstSuccess.Sub(state.started).Seconds(), 3)
}
if !firstWrite.IsZero() {
summary.FirstWriteAfterStopSec = round(firstWrite.Sub(state.started).Seconds(), 3)
}
if !firstOther.IsZero() {
summary.FirstOtherSuccessSec = round(firstOther.Sub(state.started).Seconds(), 3)
}
if !lastTarget.IsZero() {
summary.TargetLastResponseAt = lastTarget.UTC().Format(time.RFC3339Nano)
}
return summary
}
+273
View File
@@ -0,0 +1,273 @@
// Command messenger runs the lab3 HTTP API and the container healthcheck
// helper. PostgreSQL holds users, chats, membership, messages and idempotency
// records; Valkey holds server-side sessions shared by every API replica.
package main
import (
"context"
"errors"
"flag"
"fmt"
"io"
"log/slog"
"net"
"net/http"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
"time"
"mtusi.ru/messenger-lab3/internal/api"
"mtusi.ru/messenger-lab3/internal/config"
"mtusi.ru/messenger-lab3/internal/session"
"mtusi.ru/messenger-lab3/internal/store"
"mtusi.ru/messenger-lab3/internal/uuid"
)
// Overridden at build time with -X main.version=... and -X main.revision=...
var (
version = "dev"
revision = "unknown"
)
const idempotencyRetention = 24 * time.Hour
func main() {
healthcheck := flag.Bool("healthcheck", false, "probe the local liveness endpoint and exit 0/1")
flag.Parse()
cfg, err := config.Load()
if err != nil {
fmt.Fprintln(os.Stderr, "configuration error:", err)
os.Exit(2)
}
if *healthcheck {
os.Exit(runHealthcheck(cfg))
}
logger := newLogger(cfg)
ctx := context.Background()
instanceID := instanceIdentity()
repository, err := store.Open(ctx, cfg.DatabaseURL, store.Options{
MaxConns: cfg.DBMaxConns,
MinConns: cfg.DBMinConns,
ConnectTimeout: cfg.DBConnectTimeout,
StatementTimeout: cfg.DBStatementTimeout,
QueryTimeout: cfg.QueryTimeout,
})
if err != nil {
logger.Error("database configuration failed", "error", err)
os.Exit(2)
}
defer repository.Close()
if err := waitForDatabase(ctx, repository, cfg.StartupTimeout, logger); err != nil {
logger.Error("postgres did not become ready", "timeout_seconds", int(cfg.StartupTimeout.Seconds()), "error", err)
os.Exit(1)
}
sessions, err := session.Open(cfg.CacheURL, session.Options{
PoolSize: cfg.CachePoolSize,
DialTimeout: cfg.CacheTimeout,
IOTimeout: cfg.CacheTimeout,
TTL: cfg.SessionTTL,
})
if err != nil {
logger.Error("session store configuration failed", "error", err)
os.Exit(2)
}
defer func() { _ = sessions.Close() }()
app, err := api.New(repository, sessions, logger, instanceID, version)
if err != nil {
logger.Error("application initialization failed", "error", err)
os.Exit(1)
}
server := &http.Server{
Handler: app.Handler(),
ReadHeaderTimeout: 5 * time.Second,
ReadTimeout: 15 * time.Second,
WriteTimeout: 20 * time.Second,
IdleTimeout: 60 * time.Second,
MaxHeaderBytes: 1 << 20,
}
address := net.JoinHostPort(cfg.Host, strconv.Itoa(cfg.Port))
listener, err := net.Listen("tcp", address)
if err != nil {
logger.Error("listen failed", "address", address, "error", err)
os.Exit(1)
}
// Operator-only stats listener. It is bound to container loopback by
// default and is not published by compose, so it cannot bypass the LB.
var metricsServer *http.Server
if cfg.MetricsAddr != "off" {
metricsMux := http.NewServeMux()
metricsMux.HandleFunc("/internal/stats", app.InternalStatsHandler)
metricsServer = &http.Server{
Handler: metricsMux,
ReadHeaderTimeout: 2 * time.Second,
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Second,
}
metricsListener, listenErr := net.Listen("tcp", cfg.MetricsAddr)
if listenErr != nil {
logger.Error("metrics listen failed", "address", cfg.MetricsAddr, "error", listenErr)
os.Exit(1)
}
go func() {
if serveErr := metricsServer.Serve(metricsListener); serveErr != nil && !errors.Is(serveErr, http.ErrServerClosed) {
logger.Error("metrics server stopped unexpectedly", "error", serveErr)
}
}()
}
pruneCtx, pruneCancel := context.WithCancel(ctx)
defer pruneCancel()
go pruneIdempotency(pruneCtx, repository, logger)
logger.Info("server listening",
"address", listener.Addr().String(),
"env", cfg.Env,
"instance_id", instanceID,
"version", version,
"revision", revision,
"session_ttl_seconds", int(cfg.SessionTTL.Seconds()),
"shutdown_timeout_seconds", int(cfg.ShutdownTimeout.Seconds()),
"shutdown_drain_seconds", int(cfg.ShutdownDrain.Seconds()),
"db_max_conns", cfg.DBMaxConns,
)
serveErrors := make(chan error, 1)
go func() {
serveErrors <- server.Serve(listener)
}()
signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT)
select {
case received := <-signals:
logger.Info("shutdown initiated", "signal", received.String(), "instance_id", instanceID)
// Stop advertising readiness first. The load balancer removes this
// backend during the drain window while the process still accepts
// requests, so in-flight work is not cut off by the health transition.
app.SetReady(false)
if cfg.ShutdownDrain > 0 {
logger.Info("draining", "seconds", int(cfg.ShutdownDrain.Seconds()))
time.Sleep(cfg.ShutdownDrain)
}
started := time.Now()
shutdownCtx, cancel := context.WithTimeout(context.Background(), cfg.ShutdownTimeout)
defer cancel()
if err := server.Shutdown(shutdownCtx); err != nil {
logger.Error("graceful shutdown failed", "error", err)
_ = server.Close()
os.Exit(1)
}
if metricsServer != nil {
_ = metricsServer.Close()
}
pruneCancel()
logger.Info("shutdown complete",
"instance_id", instanceID,
"elapsed_ms", float64(time.Since(started).Microseconds())/1000.0,
)
os.Exit(0)
case err := <-serveErrors:
if err != nil && !errors.Is(err, http.ErrServerClosed) {
logger.Error("server stopped unexpectedly", "error", err)
os.Exit(1)
}
}
}
// instanceIdentity is stable for the lifetime of this process and unique per
// container. INSTANCE_ID overrides it; otherwise the container hostname is the
// actual process identity, which lets scripts/stop-one.sh map an X-Instance-Id
// response to exactly one Docker container. lab7 replaces this with an opaque
// alias that does not reveal a hostname.
func instanceIdentity() string {
if value := strings.TrimSpace(os.Getenv("INSTANCE_ID")); value != "" {
return value
}
if hostname, err := os.Hostname(); err == nil && strings.TrimSpace(hostname) != "" {
return hostname
}
return uuid.NewRandom(8)
}
func newLogger(cfg config.Config) *slog.Logger {
handler := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: cfg.LogLevel})
return slog.New(handler).With("service", "messenger-lab3", "app_env", cfg.Env)
}
func waitForDatabase(ctx context.Context, repository *store.Store, timeout time.Duration, logger *slog.Logger) error {
deadline := time.Now().Add(timeout)
attempt := 0
for {
attempt++
pingCtx, cancel := context.WithTimeout(ctx, 2*time.Second)
err := repository.Ping(pingCtx)
cancel()
if err == nil {
return nil
}
if time.Now().After(deadline) {
return err
}
logger.Debug("waiting for postgres", "attempt", attempt, "error", err)
time.Sleep(500 * time.Millisecond)
}
}
func pruneIdempotency(ctx context.Context, repository *store.Store, logger *slog.Logger) {
run := func() {
pruneCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
deleted, err := repository.PruneIdempotency(pruneCtx, idempotencyRetention)
cancel()
if err != nil && ctx.Err() == nil {
logger.Warn("idempotency prune failed", "error", err)
return
}
if deleted > 0 {
logger.Info("pruned expired idempotency records", "rows", deleted, "retention_hours", 24)
}
}
run()
ticker := time.NewTicker(time.Hour)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
run()
}
}
}
// runHealthcheck is compiled into the same binary as the server, so the
// runtime image needs no curl, wget or shell. It always talks to loopback
// inside the container, independently of APP_HOST.
func runHealthcheck(cfg config.Config) int {
client := &http.Client{Timeout: 2 * time.Second}
url := "http://127.0.0.1:" + strconv.Itoa(cfg.Port) + "/health/live"
response, err := client.Get(url) //nolint:gosec // fixed loopback URL built from a validated port
if err != nil {
fmt.Fprintln(os.Stderr, "healthcheck request failed:", err)
return 1
}
defer response.Body.Close()
_, _ = io.Copy(io.Discard, response.Body)
if response.StatusCode != http.StatusOK {
fmt.Fprintln(os.Stderr, "healthcheck status:", response.StatusCode)
return 1
}
return 0
}
+69
View File
@@ -0,0 +1,69 @@
// Command migrate applies the embedded, checksummed PostgreSQL migrations and
// exits. It is a separate one-shot compose service: API replicas never race to
// migrate the shared schema. The advisory lock inside store.Migrate serialises
// concurrent invocations of this command as well.
package main
import (
"context"
"flag"
"fmt"
"log/slog"
"os"
"time"
"mtusi.ru/messenger-lab3/internal/config"
"mtusi.ru/messenger-lab3/internal/store"
)
var revision = "unknown"
func main() {
flag.Parse()
logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelInfo})).
With("service", "messenger-lab3-migrate", "revision", revision)
cfg, err := config.Load()
if err != nil {
logger.Error("configuration error", "error", err)
os.Exit(2)
}
ctx, cancel := context.WithTimeout(context.Background(), 90*time.Second)
defer cancel()
repository, err := store.Open(ctx, cfg.DatabaseURL, store.Options{
MaxConns: cfg.DBMaxConns,
MinConns: 0,
ConnectTimeout: cfg.DBConnectTimeout,
StatementTimeout: cfg.DBStatementTimeout,
QueryTimeout: cfg.QueryTimeout,
})
if err != nil {
logger.Error("database configuration failed", "error", err)
os.Exit(2)
}
defer repository.Close()
for {
pingCtx, pingCancel := context.WithTimeout(ctx, 2*time.Second)
err = repository.Ping(pingCtx)
pingCancel()
if err == nil {
break
}
if ctx.Err() != nil {
logger.Error("postgres did not become ready", "error", err)
os.Exit(1)
}
logger.Info("waiting for postgres", "error", err)
time.Sleep(500 * time.Millisecond)
}
started := time.Now()
if err := repository.Migrate(ctx); err != nil {
logger.Error("migrations failed", "error", err)
os.Exit(1)
}
logger.Info("migrations complete", "elapsed_ms", float64(time.Since(started).Microseconds())/1000.0)
fmt.Println("migrations: up-to-date")
}
+226
View File
@@ -0,0 +1,226 @@
# Lab3 local teaching stand: client -> HAProxy -> 2+ interchangeable API
# processes -> shared PostgreSQL and shared Valkey.
#
# There is intentionally no container_name: a Compose service with fixed
# container names cannot be scaled. Every replica gets its own container ID,
# hostname and X-Instance-Id. API ports are not published; the only public
# route is the load balancer on 127.0.0.1:8083.
#
# Start: make env && make up
# Stop: make stop (processes stopped, named volumes and data preserved)
# Remove: make down (containers removed, volumes preserved)
# Purge: make purge (containers AND named volumes removed; explicit data loss)
name: ${COMPOSE_PROJECT_NAME:-mtusi-lab3-melnikov}
x-api-build: &api-build
context: .
args:
VERSION: ${APP_VERSION:-1.0.0}
REVISION: ${GIT_REVISION:-unknown}
services:
postgres:
image: postgres:16.4-alpine3.20@sha256:5660c2cbfea50c7a9127d17dc4e48543eedd3d7a41a595a2dfa572471e37e64c
environment:
POSTGRES_USER: ${POSTGRES_USER:-messenger}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env via make env}
POSTGRES_DB: ${POSTGRES_DB:-messenger}
PGDATA: /var/lib/postgresql/data/pgdata
command:
- postgres
- -c
- max_connections=100
- -c
- shared_buffers=128MB
- -c
- effective_cache_size=256MB
- -c
- work_mem=4MB
- -c
- maintenance_work_mem=64MB
- -c
- max_wal_size=4GB
- -c
- checkpoint_timeout=30min
- -c
- checkpoint_completion_target=0.9
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 3s
timeout: 3s
retries: 20
start_period: 5s
restart: unless-stopped
security_opt:
- no-new-privileges:true
stop_grace_period: 20s
deploy:
resources:
limits:
cpus: "${POSTGRES_CPU_LIMIT:-0.7}"
memory: ${POSTGRES_MEM_LIMIT:-512M}
valkey:
image: valkey/valkey:8.0.2-alpine@sha256:752ba000a58bc8925d11ee863a39b5225617cd2cb3dbc9ec8ac65268b65ebb6d
environment:
VALKEY_PASSWORD: ${VALKEY_PASSWORD:?set VALKEY_PASSWORD in .env via make env}
# Shared session store. AOF everysec is the durability boundary: graceful
# restart keeps acknowledged sessions; a hard crash can lose up to one
# second of session writes. TTLs are absolute deadlines, so replaying the
# AOF neither revives nor extends a session.
command:
- valkey-server
- --appendonly
- "yes"
- --appendfsync
- everysec
- --requirepass
- ${VALKEY_PASSWORD:?set VALKEY_PASSWORD in .env via make env}
- --protected-mode
- "no"
volumes:
- valkeydata:/data
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "valkey-cli --no-auth-warning -a \"$$VALKEY_PASSWORD\" ping | grep -q PONG"]
interval: 3s
timeout: 3s
retries: 20
start_period: 5s
restart: unless-stopped
security_opt:
- no-new-privileges:true
stop_grace_period: 20s
deploy:
resources:
limits:
cpus: "${VALKEY_CPU_LIMIT:-0.1}"
memory: ${VALKEY_MEM_LIMIT:-128M}
# One-shot migration runner. API replicas depend on this service completing,
# so the schema is never migrated by a race between replicas. The advisory
# lock and checksums make a repeated invocation safe.
migrate:
image: ${API_IMAGE:-mtusi-messenger-lab3-melnikov:local}
build: *api-build
entrypoint: ["/app/migrate"]
environment:
APP_ENV: ${APP_ENV:-lab}
LOG_LEVEL: ${LOG_LEVEL:-info}
DATABASE_URL: postgres://${POSTGRES_USER:-messenger}:${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env via make env}@postgres:5432/${POSTGRES_DB:-messenger}?sslmode=disable
CACHE_URL: redis://:${VALKEY_PASSWORD:?set VALKEY_PASSWORD in .env via make env}@valkey:6379/0
DB_MAX_CONNS: "2"
DB_CONNECT_TIMEOUT_SECONDS: "3"
DB_STATEMENT_TIMEOUT_SECONDS: "10"
DB_QUERY_TIMEOUT_SECONDS: "10"
depends_on:
postgres:
condition: service_healthy
networks:
- backend
restart: "no"
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
cpus: "0.25"
memory: 128M
api:
image: ${API_IMAGE:-mtusi-messenger-lab3-melnikov:local}
build: *api-build
environment:
APP_HOST: 0.0.0.0
APP_PORT: "8080"
APP_ENV: ${APP_ENV:-lab}
LOG_LEVEL: ${LOG_LEVEL:-info}
DATABASE_URL: postgres://${POSTGRES_USER:-messenger}:${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env via make env}@postgres:5432/${POSTGRES_DB:-messenger}?sslmode=disable
CACHE_URL: redis://:${VALKEY_PASSWORD:?set VALKEY_PASSWORD in .env via make env}@valkey:6379/0
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
DB_MAX_CONNS: ${DB_MAX_CONNS:-8}
DB_MIN_CONNS: ${DB_MIN_CONNS:-1}
DB_CONNECT_TIMEOUT_SECONDS: ${DB_CONNECT_TIMEOUT_SECONDS:-3}
DB_STATEMENT_TIMEOUT_SECONDS: ${DB_STATEMENT_TIMEOUT_SECONDS:-3}
DB_QUERY_TIMEOUT_SECONDS: ${DB_QUERY_TIMEOUT_SECONDS:-3}
CACHE_POOL_SIZE: ${CACHE_POOL_SIZE:-8}
CACHE_TIMEOUT_SECONDS: ${CACHE_TIMEOUT_SECONDS:-2}
SHUTDOWN_TIMEOUT_SECONDS: ${SHUTDOWN_TIMEOUT_SECONDS:-6}
SHUTDOWN_DRAIN_SECONDS: ${SHUTDOWN_DRAIN_SECONDS:-3}
STARTUP_TIMEOUT_SECONDS: ${STARTUP_TIMEOUT_SECONDS:-30}
METRICS_ADDR: 127.0.0.1:9090
GOMEMLIMIT: ${GOMEMLIMIT:-220MiB}
depends_on:
postgres:
condition: service_healthy
valkey:
condition: service_healthy
migrate:
condition: service_completed_successfully
networks:
- backend
healthcheck:
test: ["CMD", "/app/messenger", "-healthcheck"]
interval: 3s
timeout: 2s
retries: 12
start_period: 10s
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
stop_grace_period: 15s
deploy:
replicas: ${API_REPLICAS:-2}
resources:
limits:
cpus: "${API_CPU_LIMIT:-0.4}"
memory: ${API_MEM_LIMIT:-256M}
lb:
image: haproxy:3.0-alpine@sha256:457d1c0dcbf2dfc0e0358723c07df4410d30e7de42bec036b383cfede4a5dbe3
volumes:
- ./infra/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
ports:
- "127.0.0.1:${LB_PORT:-8083}:8080"
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:8404/stats || exit 1"]
interval: 3s
timeout: 2s
retries: 10
start_period: 5s
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
stop_grace_period: 10s
deploy:
resources:
limits:
cpus: "${LB_CPU_LIMIT:-0.2}"
memory: ${LB_MEM_LIMIT:-64M}
volumes:
pgdata:
name: ${COMPOSE_PROJECT_NAME:-mtusi-lab3-melnikov}-pgdata
valkeydata:
name: ${COMPOSE_PROJECT_NAME:-mtusi-lab3-melnikov}-valkeydata
networks:
backend:
name: ${COMPOSE_PROJECT_NAME:-mtusi-lab3-melnikov}-net
+4
View File
@@ -0,0 +1,4 @@
== check (2026-12-02T16:25:04Z) ==
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
exit_code: 0
+267
View File
@@ -0,0 +1,267 @@
== clean clone ==
source revision: 1a7f31e7e5ee25e5f34b7b851d068c5cce77ed43
clone: /Users/ivanmuller/Desktop/oh_my_life/.local/highload-tasks/lab3-artifacts/clean-clone.EazRmV
project: mtusi-lab3-melnikov-clean; LB port: 8084
== environment and validation ==
wrote .env with generated local synthetic credentials (mode 600); values not printed
/usr/bin/python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
WARNING: You are using pip version 21.2.4; however, version 26.0.1 is available.
You should consider upgrading via the '/Users/ivanmuller/Desktop/oh_my_life/.local/highload-tasks/lab3-artifacts/clean-clone.EazRmV/.venv/bin/python -m pip install --upgrade pip' command.
.venv/bin/python scripts/validate_openapi.py
/Users/ivanmuller/Desktop/oh_my_life/.local/highload-tasks/lab3-artifacts/clean-clone.EazRmV/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
warnings.warn(
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
== build and start from empty named volumes ==
GIT_REVISION="1a7f31e7e5ee25e5f34b7b851d068c5cce77ed43" API_IMAGE="mtusi-lab3-melnikov-clean:local" ./scripts/compose.sh --env-file .env up -d --build
time="2026-12-02T19:36:26+03:00" level=warning msg="Docker Compose is configured to build using Bake, but buildx isn't installed"
#0 building with "colima" instance using docker driver
#1 [migrate internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.03kB done
#1 DONE 0.0s
#2 [migrate] resolve image config for docker-image://docker.io/docker/dockerfile:1
#2 DONE 0.8s
#3 [migrate] docker-image://docker.io/docker/dockerfile:1@sha256:572cebbc2b15e6f84c077742952674889cb63cd5e9b80abdffcbe587b6f19183
#3 CACHED
#4 [migrate internal] load metadata for docker.io/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
#4 DONE 0.0s
#5 [migrate internal] load metadata for docker.io/library/golang:1.25.1-alpine3.22@sha256:b6ed3fd0452c0e9bcdef5597f29cc1418f61672e9d3a2f55bf02e7222c014abd
#5 DONE 0.0s
#6 [migrate internal] load .dockerignore
#6 transferring context: 196B done
#6 DONE 0.0s
#7 [migrate build 1/7] FROM docker.io/library/golang:1.25.1-alpine3.22@sha256:b6ed3fd0452c0e9bcdef5597f29cc1418f61672e9d3a2f55bf02e7222c014abd
#7 DONE 0.0s
#8 [migrate runtime 1/4] FROM docker.io/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
#8 DONE 0.0s
#9 [migrate internal] load build context
#9 transferring context: 8.77MB 0.1s done
#9 DONE 0.1s
#10 [migrate build 3/7] COPY go.mod go.sum ./
#10 CACHED
#11 [migrate build 4/7] COPY vendor ./vendor
#11 CACHED
#12 [migrate build 5/7] COPY cmd ./cmd
#12 CACHED
#13 [migrate build 2/7] WORKDIR /src
#13 CACHED
#14 [migrate build 6/7] COPY internal ./internal
#14 CACHED
#15 [migrate build 7/7] RUN go build -trimpath -buildvcs=false -ldflags="-s -w -buildid= -X main.version=1.0.0 -X main.revision=1a7f31e7e5ee25e5f34b7b851d068c5cce77ed43" -o /out/messenger ./cmd/messenger && go build -trimpath -buildvcs=false -ldflags="-s -w -buildid= -X main.revision=1a7f31e7e5ee25e5f34b7b851d068c5cce77ed43" -o /out/migrate ./cmd/migrate
#15 DONE 13.2s
#16 [migrate runtime 2/4] WORKDIR /app
#16 CACHED
#17 [migrate runtime 3/4] COPY --from=build --chown=10001:10001 /out/messenger /app/messenger
#17 DONE 0.0s
#18 [migrate runtime 4/4] COPY --from=build --chown=10001:10001 /out/migrate /app/migrate
#18 DONE 0.0s
#19 [migrate] exporting to image
#19 exporting layers 0.0s done
#19 writing image sha256:94c56acec8dc46c66eaa238bf3a037f9826092a80c61b09df79a1e70f8e015f1 done
#19 naming to docker.io/library/mtusi-lab3-melnikov-clean:local done
#19 DONE 0.0s
#20 [migrate] resolving provenance for metadata file
#20 DONE 0.0s
#21 [api internal] load build definition from Dockerfile
#21 transferring dockerfile: 2.03kB done
#21 DONE 0.0s
#2 [api] resolve image config for docker-image://docker.io/docker/dockerfile:1
#2 DONE 1.1s
#3 [api] docker-image://docker.io/docker/dockerfile:1@sha256:572cebbc2b15e6f84c077742952674889cb63cd5e9b80abdffcbe587b6f19183
#3 CACHED
#4 [api internal] load metadata for docker.io/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
#4 DONE 0.0s
#5 [api internal] load metadata for docker.io/library/golang:1.25.1-alpine3.22@sha256:b6ed3fd0452c0e9bcdef5597f29cc1418f61672e9d3a2f55bf02e7222c014abd
#5 DONE 0.0s
#22 [api internal] load .dockerignore
#22 transferring context: 196B done
#22 DONE 0.0s
#8 [api runtime 1/4] FROM docker.io/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
#8 DONE 0.0s
#7 [api build 1/7] FROM docker.io/library/golang:1.25.1-alpine3.22@sha256:b6ed3fd0452c0e9bcdef5597f29cc1418f61672e9d3a2f55bf02e7222c014abd
#7 DONE 0.0s
#23 [api internal] load build context
#23 transferring context: 34.97kB 0.0s done
#23 DONE 0.0s
#24 [api build 5/7] COPY cmd ./cmd
#24 CACHED
#25 [api build 6/7] COPY internal ./internal
#25 CACHED
#26 [api runtime 3/4] COPY --from=build --chown=10001:10001 /out/messenger /app/messenger
#26 CACHED
#27 [api build 7/7] RUN go build -trimpath -buildvcs=false -ldflags="-s -w -buildid= -X main.version=1.0.0 -X main.revision=1a7f31e7e5ee25e5f34b7b851d068c5cce77ed43" -o /out/messenger ./cmd/messenger && go build -trimpath -buildvcs=false -ldflags="-s -w -buildid= -X main.revision=1a7f31e7e5ee25e5f34b7b851d068c5cce77ed43" -o /out/migrate ./cmd/migrate
#27 CACHED
#28 [api build 4/7] COPY vendor ./vendor
#28 CACHED
#29 [api build 3/7] COPY go.mod go.sum ./
#29 CACHED
#16 [api runtime 2/4] WORKDIR /app
#16 CACHED
#13 [api build 2/7] WORKDIR /src
#13 CACHED
#30 [api runtime 4/4] COPY --from=build --chown=10001:10001 /out/migrate /app/migrate
#30 CACHED
#31 [api] exporting to image
#31 exporting layers done
#31 writing image sha256:91fdb7b0d1c400650633c114fa6624efb4d075f57826eaf1762ecb32c8c16405 done
#31 naming to docker.io/library/mtusi-lab3-melnikov-clean:local done
#31 DONE 0.0s
#32 [api] resolving provenance for metadata file
#32 DONE 0.0s
api Built
migrate Built
Network mtusi-lab3-melnikov-clean-net Creating
Network mtusi-lab3-melnikov-clean-net Created
Volume "mtusi-lab3-melnikov-clean-pgdata" Creating
Volume "mtusi-lab3-melnikov-clean-pgdata" Created
Volume "mtusi-lab3-melnikov-clean-valkeydata" Creating
Volume "mtusi-lab3-melnikov-clean-valkeydata" Created
Container mtusi-lab3-melnikov-clean-lb-1 Creating
Container mtusi-lab3-melnikov-clean-postgres-1 Creating
Container mtusi-lab3-melnikov-clean-valkey-1 Creating
Container mtusi-lab3-melnikov-clean-postgres-1 Created
Container mtusi-lab3-melnikov-clean-lb-1 Created
Container mtusi-lab3-melnikov-clean-migrate-1 Creating
Container mtusi-lab3-melnikov-clean-valkey-1 Created
Container mtusi-lab3-melnikov-clean-migrate-1 Created
Container mtusi-lab3-melnikov-clean-api-2 Creating
Container mtusi-lab3-melnikov-clean-api-1 Creating
Container mtusi-lab3-melnikov-clean-api-1 Created
Container mtusi-lab3-melnikov-clean-api-2 Created
Container mtusi-lab3-melnikov-clean-valkey-1 Starting
Container mtusi-lab3-melnikov-clean-lb-1 Starting
Container mtusi-lab3-melnikov-clean-postgres-1 Starting
Container mtusi-lab3-melnikov-clean-postgres-1 Started
Container mtusi-lab3-melnikov-clean-postgres-1 Waiting
Container mtusi-lab3-melnikov-clean-valkey-1 Started
Container mtusi-lab3-melnikov-clean-lb-1 Started
Container mtusi-lab3-melnikov-clean-postgres-1 Healthy
Container mtusi-lab3-melnikov-clean-migrate-1 Starting
Container mtusi-lab3-melnikov-clean-migrate-1 Started
Container mtusi-lab3-melnikov-clean-valkey-1 Waiting
Container mtusi-lab3-melnikov-clean-migrate-1 Waiting
Container mtusi-lab3-melnikov-clean-postgres-1 Waiting
Container mtusi-lab3-melnikov-clean-valkey-1 Healthy
Container mtusi-lab3-melnikov-clean-migrate-1 Exited
Container mtusi-lab3-melnikov-clean-postgres-1 Healthy
Container mtusi-lab3-melnikov-clean-api-1 Starting
Container mtusi-lab3-melnikov-clean-api-1 Started
Container mtusi-lab3-melnikov-clean-api-2 Starting
Container mtusi-lab3-melnikov-clean-api-2 Started
./scripts/wait-ready.sh
ready: http://127.0.0.1:8084/health/ready
users=0
migrations=1,2,3
NAME STATUS
mtusi-lab3-melnikov-clean-api-1 Up Less than a second (health: starting)
mtusi-lab3-melnikov-clean-api-2 Up Less than a second (health: starting)
mtusi-lab3-melnikov-clean-lb-1 Up 6 seconds (healthy)
mtusi-lab3-melnikov-clean-postgres-1 Up 6 seconds (healthy)
mtusi-lab3-melnikov-clean-valkey-1 Up 6 seconds (healthy)
== public and own tests on the clean stand ==
/usr/bin/python3 tests/smoke.py --base-url "http://127.0.0.1:8084"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
go test -count=1 ./...
? mtusi.ru/messenger-lab3/cmd/loadgen [no test files]
? mtusi.ru/messenger-lab3/cmd/messenger [no test files]
? mtusi.ru/messenger-lab3/cmd/migrate [no test files]
ok mtusi.ru/messenger-lab3/internal/api 0.462s
ok mtusi.ru/messenger-lab3/internal/auth 0.932s
ok mtusi.ru/messenger-lab3/internal/config 0.870s
ok mtusi.ru/messenger-lab3/internal/cursor 0.189s
ok mtusi.ru/messenger-lab3/internal/model 1.068s
? mtusi.ru/messenger-lab3/internal/session [no test files]
ok mtusi.ru/messenger-lab3/internal/store 1.252s
ok mtusi.ru/messenger-lab3/internal/uuid 1.419s
/usr/bin/python3 student-tests/blackbox.py --base-url "http://127.0.0.1:8084"
PASS health
PASS registration/auth
PASS registration validation
PASS chats/membership
PASS messages
PASS instances (2 observed)
PASS idempotency replay/conflict/scope/validation
PASS concurrent idempotency across 2 replicas
PASS pagination
PASS concurrent registration
PASS concurrent messages
PASS logout
PASS: lab3 student black-box suite, 141 checks
/usr/bin/python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1:8084"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
== intentional cleanup of this temporary clone's resources ==
5
PURGE removes containers AND named volumes mtusi-lab3-melnikov-*: all synthetic data is lost.
./scripts/compose.sh --env-file .env down -v
Container mtusi-lab3-melnikov-clean-api-2 Stopping
Container mtusi-lab3-melnikov-clean-lb-1 Stopping
Container mtusi-lab3-melnikov-clean-api-1 Stopping
Container mtusi-lab3-melnikov-clean-lb-1 Stopped
Container mtusi-lab3-melnikov-clean-lb-1 Removing
Container mtusi-lab3-melnikov-clean-lb-1 Removed
Container mtusi-lab3-melnikov-clean-api-1 Stopped
Container mtusi-lab3-melnikov-clean-api-1 Removing
Container mtusi-lab3-melnikov-clean-api-1 Removed
Container mtusi-lab3-melnikov-clean-api-2 Stopped
Container mtusi-lab3-melnikov-clean-api-2 Removing
Container mtusi-lab3-melnikov-clean-api-2 Removed
Container mtusi-lab3-melnikov-clean-migrate-1 Stopping
Container mtusi-lab3-melnikov-clean-valkey-1 Stopping
Container mtusi-lab3-melnikov-clean-migrate-1 Stopped
Container mtusi-lab3-melnikov-clean-migrate-1 Removing
Container mtusi-lab3-melnikov-clean-migrate-1 Removed
Container mtusi-lab3-melnikov-clean-postgres-1 Stopping
Container mtusi-lab3-melnikov-clean-postgres-1 Stopped
Container mtusi-lab3-melnikov-clean-postgres-1 Removing
Container mtusi-lab3-melnikov-clean-postgres-1 Removed
Container mtusi-lab3-melnikov-clean-valkey-1 Stopped
Container mtusi-lab3-melnikov-clean-valkey-1 Removing
Container mtusi-lab3-melnikov-clean-valkey-1 Removed
Volume mtusi-lab3-melnikov-clean-valkeydata Removing
Volume mtusi-lab3-melnikov-clean-pgdata Removing
Volume mtusi-lab3-melnikov-clean-valkeydata Removed
Network mtusi-lab3-melnikov-clean-net Removing
Volume mtusi-lab3-melnikov-clean-pgdata Removed
Network mtusi-lab3-melnikov-clean-net Removed
PASS: clean clone built, migrated, tested and removed; main stand untouched
+5
View File
@@ -0,0 +1,5 @@
== evidence collection ==
started_at: 2026-12-02T16:25:04Z
revision: 922a38b2cf98f3e0b79fd605a21e42fc30ff1028
branch: solution/bvt2301-melnikov
git_status_lines: 21
+123
View File
@@ -0,0 +1,123 @@
{
"no_container_name_in_compose": true,
"api_replica_count": 2,
"api_container_ids_distinct": true,
"api_instance_ids_distinct": true,
"api_images": [
"sha256:c999351dd1ef2d2199d0bfeb73f057d80cee077afef267e97c3de9a10ef7ed48"
],
"api_image_matches_expected_tag": true,
"api_has_no_published_ports": true,
"api_ports": {
"mtusi-lab3-melnikov-api-1": "",
"mtusi-lab3-melnikov-api-2": ""
},
"lb_published_loopback_only": true,
"lb_ports": "8080/tcp -> 127.0.0.1:8083",
"all_services_have_cpu_and_memory_limits": true,
"limits": {
"api": [
{
"name": "mtusi-lab3-melnikov-api-1",
"nano_cpus": 400000000,
"memory_bytes": 268435456,
"cpu_max": "40000 100000",
"memory_max": "268435456"
},
{
"name": "mtusi-lab3-melnikov-api-2",
"nano_cpus": 400000000,
"memory_bytes": 268435456,
"cpu_max": "40000 100000",
"memory_max": "268435456"
}
],
"postgres": [
{
"name": "mtusi-lab3-melnikov-postgres-1",
"nano_cpus": 700000000,
"memory_bytes": 536870912,
"cpu_max": "70000 100000",
"memory_max": "536870912"
}
],
"valkey": [
{
"name": "mtusi-lab3-melnikov-valkey-1",
"nano_cpus": 100000000,
"memory_bytes": 134217728,
"cpu_max": "10000 100000",
"memory_max": "134217728"
}
],
"lb": [
{
"name": "mtusi-lab3-melnikov-lb-1",
"nano_cpus": 200000000,
"memory_bytes": 67108864,
"cpu_max": "20000 100000",
"memory_max": "67108864"
}
]
},
"api_security": [
{
"name": "mtusi-lab3-melnikov-api-1",
"user": "10001:10001",
"read_only_rootfs": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"restart_policy": "unless-stopped",
"stop_grace_period_ns": 15,
"networks": [
"mtusi-lab3-melnikov-net"
],
"mounts": []
},
{
"name": "mtusi-lab3-melnikov-api-2",
"user": "10001:10001",
"read_only_rootfs": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"restart_policy": "unless-stopped",
"stop_grace_period_ns": 15,
"networks": [
"mtusi-lab3-melnikov-net"
],
"mounts": []
}
],
"api_non_root": true,
"api_read_only_rootfs": true,
"api_cap_drop_all": true,
"api_no_new_privileges": true,
"api_has_no_state_volume": true,
"all_on_same_backend_network": true,
"named_volumes": [
"mtusi-lab3-melnikov-pgdata",
"mtusi-lab3-melnikov-valkeydata"
],
"volumes_have_prefix": true,
"observed_instances": [
"b0e3637371e4",
"fdf38eb6b74b"
],
"session_crosses_replicas": true,
"session_instances_are_api_hostnames": true,
"health_ready_via_lb": true,
"health_instance_is_api": true,
"public_entrypoint_is_lb": true,
"result": "PASS",
"failed": [],
"checked_at": "2026-12-02T16:30:03.071380Z",
"base_url": "http://127.0.0.1:8083"
}
+9
View File
@@ -0,0 +1,9 @@
lab3 container checks at 2026-12-02T16:30:03.071380Z
result: PASS
API replicas: 2 (b0e3637371e4, fdf38eb6b74b)
API ports published: {'mtusi-lab3-melnikov-api-1': '', 'mtusi-lab3-melnikov-api-2': ''}
LB ports: 8080/tcp -> 127.0.0.1:8083
volumes: mtusi-lab3-melnikov-pgdata, mtusi-lab3-melnikov-valkeydata
limits: {"api":[{"name":"mtusi-lab3-melnikov-api-1","nano_cpus":400000000,"memory_bytes":268435456,"cpu_max":"40000 100000","memory_max":"268435456"},{"name":"mtusi-lab3-melnikov-api-2","nano_cpus":400000000,"memory_bytes":268435456,"cpu_max":"40000 100000","memory_max":"268435456"}],"postgres":[{"name":"mtusi-lab3-melnikov-postgres-1","nano_cpus":700000000,"memory_bytes":536870912,"cpu_max":"70000 100000","memory_max":"536870912"}],"valkey":[{"name":"mtusi-lab3-melnikov-valkey-1","nano_cpus":100000000,"memory_bytes":134217728,"cpu_max":"10000 100000","memory_max":"134217728"}],"lb":[{"name":"mtusi-lab3-melnikov-lb-1","nano_cpus":200000000,"memory_bytes":67108864,"cpu_max":"20000 100000","memory_max":"67108864"}]}
observed session instances: b0e3637371e4, fdf38eb6b74b
PASS: container and infrastructure checks
+63
View File
@@ -0,0 +1,63 @@
{
"migration_versions": "1,2,3",
"migration_versions_expected": true,
"tables": "chat_members,chats,message_idempotency,messages,schema_migrations,users",
"required_tables_present": true,
"constraints": "chat_members_chat_id_fkey,chat_members_pkey,chat_members_position_nonnegative,chat_members_user_id_fkey,chats_pkey,chats_title_length,message_idempotency_key_length,message_idempotency_message_id_fkey,message_idempotency_method_post,message_idempotency_path_length,message_idempotency_pkey,message_idempotency_user_id_fkey,messages_chat_fk,messages_pkey,messages_sender_membership_fk,messages_text_length,schema_migrations_pkey,users_display_name_length,users_password_hash_present,users_pkey,users_username_format",
"constraint_users_pkey": true,
"constraint_users_username_format": true,
"constraint_chats_title_length": true,
"constraint_chat_members_pkey": true,
"constraint_messages_sender_membership_fk": true,
"constraint_message_idempotency_pkey": true,
"indexes": "chat_members_pkey,chat_members_user_chat_idx,chats_created_id_idx,chats_pkey,message_idempotency_created_at_idx,message_idempotency_pkey,messages_chat_created_id_idx,messages_pkey,schema_migrations_pkey,users_pkey,users_username_key",
"messages_index_present": true,
"idempotency_created_index_present": true,
"data_state": {
"messages": 509052,
"idempotency": 509052,
"duplicate_scopes": 0,
"orphan_records": 0,
"old_records": 0,
"hash_lengths": [
32
]
},
"scopes_unique": true,
"records_reference_messages": true,
"retention_not_expired": true,
"hashes_are_sha256": true,
"messages_have_idempotency_records": true,
"password_hashes": {
"total": 150,
"argon2id": 150,
"plaintext_like": 0
},
"all_passwords_argon2id": true,
"settings": {
"max_connections": "100",
"shared_buffers": "128MB",
"synchronous_commit": "on",
"max_wal_size": "4GB"
},
"max_connections_sane": true,
"synchronous_commit_on": true,
"api_write_delta": {
"messages": 1,
"idempotency": 1
},
"one_message_one_record": true,
"migrate_run": {
"exit_code": 0,
"stdout_tail": [
"time=2026-12-02T16:29:45.493Z level=INFO msg=\"migrations complete\" service=messenger-lab3-migrate revision=922a38b2cf98f3e0b79fd605a21e42fc30ff1028 elapsed_ms=2.268",
"migrations: up-to-date"
],
"versions_after": "1,2,3"
},
"migrate_idempotent": true,
"migrate_output_up_to_date": true,
"result": "PASS",
"failed": [],
"checked_at": "2026-12-02T16:29:45.328910Z"
}
+8
View File
@@ -0,0 +1,8 @@
lab3 database checks at 2026-lab3 database checks at 2026-12-02T16:29:45.328910Z
result: PASS
migrations: 1,2,3; tables: chat_members,chats,message_idempotency,messages,schema_migrations,users
messages=509052 idempotency=509052; duplicate scopes=0; orphans=0; old>24h=0
password hashes: 150/150 Argon2id
API write delta: {"messages": 1, "idempotency": 1}
one-shot migrate exit: 0; versions after: 1,2,3
PASS: database checks
+5
View File
@@ -0,0 +1,5 @@
python3 scripts/failover-matrix.py --base-url "http://127.0.0.1:8083"
PASS failover target e362837fa501: 3922.806B 62770 success/0 errors, first success 0.002s, other replica 0.002s, first write 0.002s, restore 1.594s
PASS failover target 1138aef4978f: 3997.251B 63960 success/0 errors, first success 0.003s, other replica 0.003s, first write 0.207s, restore 0.612s
wrote /Users/ivanmuller/Desktop/oh_my_life/highload/lab3/evidence/failover/each-replica.json
PASS: stopped and restored each of 2 distinct API processes
@@ -0,0 +1,193 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T15:20:50.488268Z",
"finished_at": "2026-12-02T15:21:06.489711Z",
"measured_seconds": 16.002,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 40360,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 2522.234,
"offered_rps": 2522.234,
"successful_latency_ms": {
"p50": 1.897,
"p95": 5.411,
"p99": 51.351,
"max": 87.701,
"mean": 3.169
},
"status_counts": {
"200": 20000,
"201": 20360
},
"instances": {
"1b3b710ee8b7": 34486,
"286d4623fa19": 5874
},
"app_versions": {
"1.0.0": 40360
},
"kinds": {
"read": 20000,
"write": 20360
},
"series": [
{
"second": 1796224850,
"success": 1167,
"errors": 0,
"p50_ms": 2.905,
"p95_ms": 5.862,
"p99_ms": 20.031
},
{
"second": 1796224851,
"success": 2717,
"errors": 0,
"p50_ms": 2.25,
"p95_ms": 4.53,
"p99_ms": 23.012
},
{
"second": 1796224852,
"success": 2847,
"errors": 0,
"p50_ms": 1.234,
"p95_ms": 2.082,
"p99_ms": 57.141
},
{
"second": 1796224853,
"success": 2148,
"errors": 0,
"p50_ms": 3.042,
"p95_ms": 7.324,
"p99_ms": 20.46
},
{
"second": 1796224854,
"success": 2440,
"errors": 0,
"p50_ms": 2.739,
"p95_ms": 5.608,
"p99_ms": 21.487
},
{
"second": 1796224855,
"success": 2770,
"errors": 0,
"p50_ms": 1.183,
"p95_ms": 2.281,
"p99_ms": 60.519
},
{
"second": 1796224856,
"success": 2620,
"errors": 0,
"p50_ms": 2.354,
"p95_ms": 4.623,
"p99_ms": 25.295
},
{
"second": 1796224857,
"success": 2529,
"errors": 0,
"p50_ms": 2.463,
"p95_ms": 4.315,
"p99_ms": 27.288
},
{
"second": 1796224858,
"success": 2422,
"errors": 0,
"p50_ms": 1.162,
"p95_ms": 2.529,
"p99_ms": 67.87
},
{
"second": 1796224859,
"success": 2284,
"errors": 0,
"p50_ms": 1.783,
"p95_ms": 9.091,
"p99_ms": 51.09
},
{
"second": 1796224860,
"success": 2267,
"errors": 0,
"p50_ms": 2.893,
"p95_ms": 5.58,
"p99_ms": 19.855
},
{
"second": 1796224861,
"success": 3075,
"errors": 0,
"p50_ms": 1.182,
"p95_ms": 3.787,
"p99_ms": 57.88
},
{
"second": 1796224862,
"success": 2663,
"errors": 0,
"p50_ms": 1.373,
"p95_ms": 3.77,
"p99_ms": 55.762
},
{
"second": 1796224863,
"success": 1780,
"errors": 0,
"p50_ms": 3.17,
"p95_ms": 11.969,
"p99_ms": 25.463
},
{
"second": 1796224864,
"success": 2574,
"errors": 0,
"p50_ms": 1.596,
"p95_ms": 6.574,
"p99_ms": 39.102
},
{
"second": 1796224865,
"success": 2877,
"errors": 0,
"p50_ms": 1.13,
"p95_ms": 3.197,
"p99_ms": 59.883
},
{
"second": 1796224866,
"success": 1180,
"errors": 0,
"p50_ms": 2.631,
"p95_ms": 4.819,
"p99_ms": 22.043
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target 286d4623fa19; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "286d4623fa19",
"stop_started_at": "2026-12-02T15:20:53.488355Z",
"stop_finished_at": "2026-12-02T15:20:56.775656Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.287,
"first_success_after_stop_seconds": 0.005,
"first_write_after_stop_seconds": 0.005,
"successes_after_stop": 32440,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T15:20:55.126081Z"
}
}
@@ -0,0 +1,193 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T15:21:09.519285Z",
"finished_at": "2026-12-02T15:21:25.524239Z",
"measured_seconds": 16.005,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 40771,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 2547.359,
"offered_rps": 2547.359,
"successful_latency_ms": {
"p50": 1.923,
"p95": 4.865,
"p99": 47.339,
"max": 88.058,
"mean": 3.137
},
"status_counts": {
"200": 20000,
"201": 20771
},
"instances": {
"1b3b710ee8b7": 4524,
"286d4623fa19": 36247
},
"app_versions": {
"1.0.0": 40771
},
"kinds": {
"read": 20000,
"write": 20771
},
"series": [
{
"second": 1796224869,
"success": 1144,
"errors": 0,
"p50_ms": 2.856,
"p95_ms": 4.969,
"p99_ms": 18.281
},
{
"second": 1796224870,
"success": 1869,
"errors": 0,
"p50_ms": 3.441,
"p95_ms": 13.169,
"p99_ms": 21.36
},
{
"second": 1796224871,
"success": 2844,
"errors": 0,
"p50_ms": 1.249,
"p95_ms": 2.215,
"p99_ms": 55.604
},
{
"second": 1796224872,
"success": 2511,
"errors": 0,
"p50_ms": 2.392,
"p95_ms": 5.072,
"p99_ms": 28.992
},
{
"second": 1796224873,
"success": 2044,
"errors": 0,
"p50_ms": 2.836,
"p95_ms": 11.984,
"p99_ms": 26.677
},
{
"second": 1796224874,
"success": 2928,
"errors": 0,
"p50_ms": 1.178,
"p95_ms": 2.993,
"p99_ms": 58.086
},
{
"second": 1796224875,
"success": 2589,
"errors": 0,
"p50_ms": 1.824,
"p95_ms": 4.502,
"p99_ms": 48.765
},
{
"second": 1796224876,
"success": 2275,
"errors": 0,
"p50_ms": 2.69,
"p95_ms": 4.965,
"p99_ms": 27.491
},
{
"second": 1796224877,
"success": 2570,
"errors": 0,
"p50_ms": 1.25,
"p95_ms": 3.48,
"p99_ms": 60.57
},
{
"second": 1796224878,
"success": 2821,
"errors": 0,
"p50_ms": 1.352,
"p95_ms": 3.465,
"p99_ms": 45.405
},
{
"second": 1796224879,
"success": 2310,
"errors": 0,
"p50_ms": 2.661,
"p95_ms": 5.478,
"p99_ms": 26.679
},
{
"second": 1796224880,
"success": 2757,
"errors": 0,
"p50_ms": 1.313,
"p95_ms": 3.807,
"p99_ms": 55.155
},
{
"second": 1796224881,
"success": 3015,
"errors": 0,
"p50_ms": 1.297,
"p95_ms": 3.332,
"p99_ms": 56.109
},
{
"second": 1796224882,
"success": 2368,
"errors": 0,
"p50_ms": 2.605,
"p95_ms": 4.63,
"p99_ms": 23.228
},
{
"second": 1796224883,
"success": 2651,
"errors": 0,
"p50_ms": 1.298,
"p95_ms": 4.5,
"p99_ms": 58.57
},
{
"second": 1796224884,
"success": 2959,
"errors": 0,
"p50_ms": 1.264,
"p95_ms": 3.888,
"p99_ms": 56.6
},
{
"second": 1796224885,
"success": 1116,
"errors": 0,
"p50_ms": 2.687,
"p95_ms": 4.913,
"p99_ms": 27.491
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target 1b3b710ee8b7; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "1b3b710ee8b7",
"stop_started_at": "2026-12-02T15:21:12.521297Z",
"stop_finished_at": "2026-12-02T15:21:15.837741Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.316,
"first_success_after_stop_seconds": 0.004,
"first_write_after_stop_seconds": 0.004,
"successes_after_stop": 33494,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T15:21:13.345522Z"
}
}
@@ -0,0 +1,195 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:22:47.717611Z",
"finished_at": "2026-12-02T16:23:03.718759Z",
"measured_seconds": 16.001,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 59617,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3725.746,
"offered_rps": 3725.746,
"successful_latency_ms": {
"p50": 1.702,
"p95": 4.19,
"p99": 9.036,
"max": 79.686,
"mean": 2.142
},
"status_counts": {
"200": 30978,
"201": 28639
},
"instances": {
"a5e18417a629": 7933,
"ddf2f6721b3b": 51684
},
"app_versions": {
"1.0.0": 59617
},
"kinds": {
"read": 30978,
"write": 28639
},
"series": [
{
"second": 1796228567,
"success": 1054,
"errors": 0,
"p50_ms": 1.958,
"p95_ms": 3.962,
"p99_ms": 5.182
},
{
"second": 1796228568,
"success": 4589,
"errors": 0,
"p50_ms": 1.265,
"p95_ms": 4.222,
"p99_ms": 6.836
},
{
"second": 1796228569,
"success": 2508,
"errors": 0,
"p50_ms": 2.63,
"p95_ms": 5.536,
"p99_ms": 19.966
},
{
"second": 1796228570,
"success": 4751,
"errors": 0,
"p50_ms": 1.369,
"p95_ms": 3.549,
"p99_ms": 4.774
},
{
"second": 1796228571,
"success": 2349,
"errors": 0,
"p50_ms": 2.834,
"p95_ms": 7.038,
"p99_ms": 16.131
},
{
"second": 1796228572,
"success": 3939,
"errors": 0,
"p50_ms": 1.423,
"p95_ms": 4.495,
"p99_ms": 11.475
},
{
"second": 1796228573,
"success": 3520,
"errors": 0,
"p50_ms": 2.109,
"p95_ms": 4.018,
"p99_ms": 7.379
},
{
"second": 1796228574,
"success": 3195,
"errors": 0,
"p50_ms": 2.225,
"p95_ms": 4.441,
"p99_ms": 12.905
},
{
"second": 1796228575,
"success": 3958,
"errors": 0,
"p50_ms": 1.229,
"p95_ms": 3.228,
"p99_ms": 18.667
},
{
"second": 1796228576,
"success": 3461,
"errors": 0,
"p50_ms": 2.298,
"p95_ms": 3.843,
"p99_ms": 7.413
},
{
"second": 1796228577,
"success": 4571,
"errors": 0,
"p50_ms": 1.158,
"p95_ms": 3.702,
"p99_ms": 9.721
},
{
"second": 1796228578,
"success": 3203,
"errors": 0,
"p50_ms": 2.403,
"p95_ms": 4.007,
"p99_ms": 5.72
},
{
"second": 1796228579,
"success": 4395,
"errors": 0,
"p50_ms": 1.19,
"p95_ms": 4.274,
"p99_ms": 12.274
},
{
"second": 1796228580,
"success": 2701,
"errors": 0,
"p50_ms": 2.614,
"p95_ms": 5.364,
"p99_ms": 10.414
},
{
"second": 1796228581,
"success": 5013,
"errors": 0,
"p50_ms": 1.13,
"p95_ms": 3.086,
"p99_ms": 7.026
},
{
"second": 1796228582,
"success": 2744,
"errors": 0,
"p50_ms": 2.683,
"p95_ms": 4.72,
"p99_ms": 8.292
},
{
"second": 1796228583,
"success": 3666,
"errors": 0,
"p50_ms": 1.134,
"p95_ms": 3.174,
"p99_ms": 10.105
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target a5e18417a629; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "a5e18417a629",
"stop_started_at": "2026-12-02T16:22:50.717592Z",
"stop_finished_at": "2026-12-02T16:22:53.938649Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.221,
"first_success_after_stop_seconds": 0.002,
"first_write_after_stop_seconds": 0.136,
"first_success_on_other_replica_seconds": 0.002,
"successes_after_stop": 47912,
"successes_on_other_replica_after_stop": 45832,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T16:22:52.292746Z"
}
}
@@ -0,0 +1,195 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:23:07.57413Z",
"finished_at": "2026-12-02T16:23:23.574913Z",
"measured_seconds": 16.001,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 55265,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3453.848,
"offered_rps": 3453.848,
"successful_latency_ms": {
"p50": 1.947,
"p95": 4.549,
"p99": 9.174,
"max": 44.967,
"mean": 2.313
},
"status_counts": {
"200": 28000,
"201": 27265
},
"instances": {
"a5e18417a629": 47928,
"ddf2f6721b3b": 7337
},
"app_versions": {
"1.0.0": 55265
},
"kinds": {
"read": 28000,
"write": 27265
},
"series": [
{
"second": 1796228587,
"success": 2386,
"errors": 0,
"p50_ms": 1.272,
"p95_ms": 2.593,
"p99_ms": 3.981
},
{
"second": 1796228588,
"success": 3603,
"errors": 0,
"p50_ms": 1.91,
"p95_ms": 4.464,
"p99_ms": 6.44
},
{
"second": 1796228589,
"success": 2547,
"errors": 0,
"p50_ms": 2.826,
"p95_ms": 5.492,
"p99_ms": 17.946
},
{
"second": 1796228590,
"success": 4580,
"errors": 0,
"p50_ms": 1.384,
"p95_ms": 3.895,
"p99_ms": 5.458
},
{
"second": 1796228591,
"success": 3019,
"errors": 0,
"p50_ms": 2.518,
"p95_ms": 4.202,
"p99_ms": 6.34
},
{
"second": 1796228592,
"success": 5016,
"errors": 0,
"p50_ms": 1.12,
"p95_ms": 3.094,
"p99_ms": 12.182
},
{
"second": 1796228593,
"success": 2651,
"errors": 0,
"p50_ms": 2.692,
"p95_ms": 4.618,
"p99_ms": 10.06
},
{
"second": 1796228594,
"success": 3760,
"errors": 0,
"p50_ms": 1.482,
"p95_ms": 4.901,
"p99_ms": 17.138
},
{
"second": 1796228595,
"success": 2924,
"errors": 0,
"p50_ms": 2.398,
"p95_ms": 4.434,
"p99_ms": 8.216
},
{
"second": 1796228596,
"success": 2189,
"errors": 0,
"p50_ms": 2.821,
"p95_ms": 8.487,
"p99_ms": 16.814
},
{
"second": 1796228597,
"success": 4245,
"errors": 0,
"p50_ms": 1.336,
"p95_ms": 3.939,
"p99_ms": 10.528
},
{
"second": 1796228598,
"success": 2814,
"errors": 0,
"p50_ms": 2.732,
"p95_ms": 4.38,
"p99_ms": 5.543
},
{
"second": 1796228599,
"success": 3632,
"errors": 0,
"p50_ms": 1.494,
"p95_ms": 4.544,
"p99_ms": 17.147
},
{
"second": 1796228600,
"success": 2978,
"errors": 0,
"p50_ms": 2.594,
"p95_ms": 4.704,
"p99_ms": 6.839
},
{
"second": 1796228601,
"success": 4452,
"errors": 0,
"p50_ms": 1.423,
"p95_ms": 3.362,
"p99_ms": 5.631
},
{
"second": 1796228602,
"success": 2861,
"errors": 0,
"p50_ms": 2.092,
"p95_ms": 6.618,
"p99_ms": 16.927
},
{
"second": 1796228603,
"success": 1608,
"errors": 0,
"p50_ms": 2.538,
"p95_ms": 5.181,
"p99_ms": 9.041
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target ddf2f6721b3b; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "ddf2f6721b3b",
"stop_started_at": "2026-12-02T16:23:10.574095Z",
"stop_finished_at": "2026-12-02T16:23:13.898112Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.324,
"first_success_after_stop_seconds": 0.002,
"first_write_after_stop_seconds": 0.004,
"first_success_on_other_replica_seconds": 0.002,
"successes_after_stop": 43327,
"successes_on_other_replica_after_stop": 41959,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T16:23:11.513065Z"
}
}
@@ -0,0 +1,195 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:25:54.107817Z",
"finished_at": "2026-12-02T16:26:10.109735Z",
"measured_seconds": 16.002,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 53713,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3356.616,
"offered_rps": 3356.616,
"successful_latency_ms": {
"p50": 1.946,
"p95": 4.722,
"p99": 12.376,
"max": 54.511,
"mean": 2.381
},
"status_counts": {
"200": 28000,
"201": 25713
},
"instances": {
"b0e3637371e4": 7482,
"fdf38eb6b74b": 46231
},
"app_versions": {
"1.0.0": 53713
},
"kinds": {
"read": 28000,
"write": 25713
},
"series": [
{
"second": 1796228754,
"success": 4255,
"errors": 0,
"p50_ms": 1.382,
"p95_ms": 3.235,
"p99_ms": 3.944
},
{
"second": 1796228755,
"success": 3457,
"errors": 0,
"p50_ms": 2.319,
"p95_ms": 3.936,
"p99_ms": 5.006
},
{
"second": 1796228756,
"success": 4096,
"errors": 0,
"p50_ms": 1.589,
"p95_ms": 3.879,
"p99_ms": 4.975
},
{
"second": 1796228757,
"success": 3781,
"errors": 0,
"p50_ms": 1.915,
"p95_ms": 3.753,
"p99_ms": 7.474
},
{
"second": 1796228758,
"success": 2965,
"errors": 0,
"p50_ms": 2.193,
"p95_ms": 6.071,
"p99_ms": 18.471
},
{
"second": 1796228759,
"success": 3875,
"errors": 0,
"p50_ms": 1.399,
"p95_ms": 4.172,
"p99_ms": 12.677
},
{
"second": 1796228760,
"success": 2932,
"errors": 0,
"p50_ms": 2.525,
"p95_ms": 4.247,
"p99_ms": 8.534
},
{
"second": 1796228761,
"success": 4731,
"errors": 0,
"p50_ms": 1.223,
"p95_ms": 3.485,
"p99_ms": 12.847
},
{
"second": 1796228762,
"success": 2659,
"errors": 0,
"p50_ms": 2.712,
"p95_ms": 4.861,
"p99_ms": 7.416
},
{
"second": 1796228763,
"success": 3914,
"errors": 0,
"p50_ms": 1.373,
"p95_ms": 4.544,
"p99_ms": 17.897
},
{
"second": 1796228764,
"success": 2729,
"errors": 0,
"p50_ms": 2.717,
"p95_ms": 5.702,
"p99_ms": 10.282
},
{
"second": 1796228765,
"success": 3534,
"errors": 0,
"p50_ms": 2.057,
"p95_ms": 4.456,
"p99_ms": 6.999
},
{
"second": 1796228766,
"success": 2653,
"errors": 0,
"p50_ms": 2.239,
"p95_ms": 6.835,
"p99_ms": 20.579
},
{
"second": 1796228767,
"success": 2537,
"errors": 0,
"p50_ms": 2.921,
"p95_ms": 5.395,
"p99_ms": 8.475
},
{
"second": 1796228768,
"success": 1293,
"errors": 0,
"p50_ms": 3.994,
"p95_ms": 18.2,
"p99_ms": 24.437
},
{
"second": 1796228769,
"success": 4053,
"errors": 0,
"p50_ms": 1.447,
"p95_ms": 4.079,
"p99_ms": 10.707
},
{
"second": 1796228770,
"success": 249,
"errors": 0,
"p50_ms": 3.254,
"p95_ms": 5.41,
"p99_ms": 7.191
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target b0e3637371e4; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "b0e3637371e4",
"stop_started_at": "2026-12-02T16:25:57.107794Z",
"stop_finished_at": "2026-12-02T16:26:00.303797Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.196,
"first_success_after_stop_seconds": 0.001,
"first_write_after_stop_seconds": 0.114,
"first_success_on_other_replica_seconds": 0.001,
"successes_after_stop": 41196,
"successes_on_other_replica_after_stop": 39972,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T16:25:57.794456Z"
}
}
@@ -0,0 +1,195 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:26:12.672201Z",
"finished_at": "2026-12-02T16:26:28.675075Z",
"measured_seconds": 16.003,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 22938,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1433.349,
"offered_rps": 1433.349,
"successful_latency_ms": {
"p50": 3.807,
"p95": 15.645,
"p99": 33.773,
"max": 151.4,
"mean": 5.578
},
"status_counts": {
"200": 12000,
"201": 10938
},
"instances": {
"b0e3637371e4": 18459,
"fdf38eb6b74b": 4479
},
"app_versions": {
"1.0.0": 22938
},
"kinds": {
"read": 12000,
"write": 10938
},
"series": [
{
"second": 1796228772,
"success": 727,
"errors": 0,
"p50_ms": 3.34,
"p95_ms": 5.831,
"p99_ms": 8.38
},
{
"second": 1796228773,
"success": 1342,
"errors": 0,
"p50_ms": 4.068,
"p95_ms": 18.277,
"p99_ms": 27.315
},
{
"second": 1796228774,
"success": 2745,
"errors": 0,
"p50_ms": 2.27,
"p95_ms": 6.244,
"p99_ms": 11.905
},
{
"second": 1796228775,
"success": 1850,
"errors": 0,
"p50_ms": 3.898,
"p95_ms": 8.786,
"p99_ms": 12.192
},
{
"second": 1796228776,
"success": 1841,
"errors": 0,
"p50_ms": 3.756,
"p95_ms": 7.851,
"p99_ms": 22.353
},
{
"second": 1796228777,
"success": 822,
"errors": 0,
"p50_ms": 7.421,
"p95_ms": 23.718,
"p99_ms": 56.951
},
{
"second": 1796228778,
"success": 629,
"errors": 0,
"p50_ms": 9.365,
"p95_ms": 36.431,
"p99_ms": 50.821
},
{
"second": 1796228779,
"success": 594,
"errors": 0,
"p50_ms": 8.971,
"p95_ms": 42.019,
"p99_ms": 67.12
},
{
"second": 1796228780,
"success": 624,
"errors": 0,
"p50_ms": 7.402,
"p95_ms": 57.271,
"p99_ms": 84.134
},
{
"second": 1796228781,
"success": 1197,
"errors": 0,
"p50_ms": 5.1,
"p95_ms": 16.221,
"p99_ms": 25.28
},
{
"second": 1796228782,
"success": 1550,
"errors": 0,
"p50_ms": 4.416,
"p95_ms": 10.796,
"p99_ms": 20.765
},
{
"second": 1796228783,
"success": 635,
"errors": 0,
"p50_ms": 9.881,
"p95_ms": 27.528,
"p99_ms": 53.167
},
{
"second": 1796228784,
"success": 730,
"errors": 0,
"p50_ms": 7.88,
"p95_ms": 30.809,
"p99_ms": 39.79
},
{
"second": 1796228785,
"success": 936,
"errors": 0,
"p50_ms": 6.733,
"p95_ms": 20.302,
"p99_ms": 33.384
},
{
"second": 1796228786,
"success": 1509,
"errors": 0,
"p50_ms": 4.613,
"p95_ms": 10.19,
"p99_ms": 19.041
},
{
"second": 1796228787,
"success": 3323,
"errors": 0,
"p50_ms": 1.754,
"p95_ms": 5.397,
"p99_ms": 14.6
},
{
"second": 1796228788,
"success": 1884,
"errors": 0,
"p50_ms": 2.681,
"p95_ms": 5.482,
"p99_ms": 9.399
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target fdf38eb6b74b; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "fdf38eb6b74b",
"stop_started_at": "2026-12-02T16:26:15.672192Z",
"stop_finished_at": "2026-12-02T16:26:19.351598Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.679,
"first_success_after_stop_seconds": 0.013,
"first_write_after_stop_seconds": 0.013,
"first_success_on_other_replica_seconds": 0.015,
"successes_after_stop": 16726,
"successes_on_other_replica_after_stop": 15353,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T16:26:17.527508Z"
}
}
@@ -0,0 +1,195 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:30:08.940724Z",
"finished_at": "2026-12-02T16:30:24.947429Z",
"measured_seconds": 16.001,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 62770,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3922.806,
"offered_rps": 3922.806,
"successful_latency_ms": {
"p50": 1.665,
"p95": 3.885,
"p99": 7.528,
"max": 80.514,
"mean": 2.037
},
"status_counts": {
"200": 32000,
"201": 30770
},
"instances": {
"1138aef4978f": 53628,
"e362837fa501": 9142
},
"app_versions": {
"1.0.0": 62770
},
"kinds": {
"read": 32000,
"write": 30770
},
"series": [
{
"second": 1796229008,
"success": 238,
"errors": 0,
"p50_ms": 1.614,
"p95_ms": 3.725,
"p99_ms": 4.197
},
{
"second": 1796229009,
"success": 5021,
"errors": 0,
"p50_ms": 1.336,
"p95_ms": 3.088,
"p99_ms": 3.934
},
{
"second": 1796229010,
"success": 2650,
"errors": 0,
"p50_ms": 2.673,
"p95_ms": 4.727,
"p99_ms": 15.526
},
{
"second": 1796229011,
"success": 4924,
"errors": 0,
"p50_ms": 1.305,
"p95_ms": 3.429,
"p99_ms": 5.149
},
{
"second": 1796229012,
"success": 2961,
"errors": 0,
"p50_ms": 2.572,
"p95_ms": 4.203,
"p99_ms": 5.369
},
{
"second": 1796229013,
"success": 5232,
"errors": 0,
"p50_ms": 1.225,
"p95_ms": 3.048,
"p99_ms": 4.748
},
{
"second": 1796229014,
"success": 3141,
"errors": 0,
"p50_ms": 2.354,
"p95_ms": 3.905,
"p99_ms": 7.595
},
{
"second": 1796229015,
"success": 4634,
"errors": 0,
"p50_ms": 1.265,
"p95_ms": 3.026,
"p99_ms": 15.736
},
{
"second": 1796229016,
"success": 3004,
"errors": 0,
"p50_ms": 2.51,
"p95_ms": 4.273,
"p99_ms": 6.141
},
{
"second": 1796229017,
"success": 5273,
"errors": 0,
"p50_ms": 1.108,
"p95_ms": 2.979,
"p99_ms": 9.079
},
{
"second": 1796229018,
"success": 2897,
"errors": 0,
"p50_ms": 2.352,
"p95_ms": 3.944,
"p99_ms": 9.247
},
{
"second": 1796229019,
"success": 5243,
"errors": 0,
"p50_ms": 1.105,
"p95_ms": 2.931,
"p99_ms": 6.54
},
{
"second": 1796229020,
"success": 2633,
"errors": 0,
"p50_ms": 2.69,
"p95_ms": 5.429,
"p99_ms": 11.247
},
{
"second": 1796229021,
"success": 4963,
"errors": 0,
"p50_ms": 1.2,
"p95_ms": 3.048,
"p99_ms": 6.285
},
{
"second": 1796229022,
"success": 2887,
"errors": 0,
"p50_ms": 2.613,
"p95_ms": 4.348,
"p99_ms": 6.816
},
{
"second": 1796229023,
"success": 4594,
"errors": 0,
"p50_ms": 1.085,
"p95_ms": 4.821,
"p99_ms": 13.288
},
{
"second": 1796229024,
"success": 2475,
"errors": 0,
"p50_ms": 2.841,
"p95_ms": 4.979,
"p99_ms": 6.621
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target e362837fa501; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "e362837fa501",
"stop_started_at": "2026-12-02T16:30:11.9407Z",
"stop_finished_at": "2026-12-02T16:30:15.164736Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.224,
"first_success_after_stop_seconds": 0.002,
"first_write_after_stop_seconds": 0.002,
"first_success_on_other_replica_seconds": 0.002,
"successes_after_stop": 50092,
"successes_on_other_replica_after_stop": 47289,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T16:30:13.435398Z"
}
}
@@ -0,0 +1,195 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:30:28.743955Z",
"finished_at": "2026-12-02T16:30:44.748592Z",
"measured_seconds": 16.001,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 63960,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3997.251,
"offered_rps": 3997.251,
"successful_latency_ms": {
"p50": 1.655,
"p95": 3.749,
"p99": 7.652,
"max": 43.545,
"mean": 1.999
},
"status_counts": {
"200": 32000,
"201": 31960
},
"instances": {
"1138aef4978f": 6980,
"e362837fa501": 56980
},
"app_versions": {
"1.0.0": 63960
},
"kinds": {
"read": 32000,
"write": 31960
},
"series": [
{
"second": 1796229028,
"success": 1020,
"errors": 0,
"p50_ms": 1.625,
"p95_ms": 4.005,
"p99_ms": 6.437
},
{
"second": 1796229029,
"success": 4836,
"errors": 0,
"p50_ms": 1.346,
"p95_ms": 3.39,
"p99_ms": 4.568
},
{
"second": 1796229030,
"success": 2209,
"errors": 0,
"p50_ms": 3.052,
"p95_ms": 7.062,
"p99_ms": 17.712
},
{
"second": 1796229031,
"success": 4392,
"errors": 0,
"p50_ms": 1.592,
"p95_ms": 3.387,
"p99_ms": 4.942
},
{
"second": 1796229032,
"success": 2894,
"errors": 0,
"p50_ms": 2.59,
"p95_ms": 4.35,
"p99_ms": 8.486
},
{
"second": 1796229033,
"success": 4807,
"errors": 0,
"p50_ms": 1.214,
"p95_ms": 3.344,
"p99_ms": 11.159
},
{
"second": 1796229034,
"success": 3172,
"errors": 0,
"p50_ms": 2.28,
"p95_ms": 4.369,
"p99_ms": 8.674
},
{
"second": 1796229035,
"success": 4558,
"errors": 0,
"p50_ms": 1.141,
"p95_ms": 3.824,
"p99_ms": 14.987
},
{
"second": 1796229036,
"success": 3400,
"errors": 0,
"p50_ms": 2.228,
"p95_ms": 3.823,
"p99_ms": 7.312
},
{
"second": 1796229037,
"success": 5285,
"errors": 0,
"p50_ms": 1.14,
"p95_ms": 2.849,
"p99_ms": 7.739
},
{
"second": 1796229038,
"success": 3244,
"errors": 0,
"p50_ms": 2.361,
"p95_ms": 3.579,
"p99_ms": 7.464
},
{
"second": 1796229039,
"success": 5066,
"errors": 0,
"p50_ms": 1.084,
"p95_ms": 3.018,
"p99_ms": 11.503
},
{
"second": 1796229040,
"success": 2805,
"errors": 0,
"p50_ms": 2.599,
"p95_ms": 4.647,
"p99_ms": 10.21
},
{
"second": 1796229041,
"success": 5362,
"errors": 0,
"p50_ms": 1.115,
"p95_ms": 3.053,
"p99_ms": 4.19
},
{
"second": 1796229042,
"success": 3156,
"errors": 0,
"p50_ms": 2.317,
"p95_ms": 4.187,
"p99_ms": 8.599
},
{
"second": 1796229043,
"success": 5268,
"errors": 0,
"p50_ms": 1.105,
"p95_ms": 2.958,
"p99_ms": 4.381
},
{
"second": 1796229044,
"success": 2486,
"errors": 0,
"p50_ms": 2.267,
"p95_ms": 3.589,
"p99_ms": 6.344
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target 1138aef4978f; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "1138aef4978f",
"stop_started_at": "2026-12-02T16:30:31.745473Z",
"stop_finished_at": "2026-12-02T16:30:35.006491Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.26,
"first_success_after_stop_seconds": 0.003,
"first_write_after_stop_seconds": 0.207,
"first_success_on_other_replica_seconds": 0.003,
"successes_after_stop": 52709,
"successes_on_other_replica_after_stop": 51355,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T16:30:32.52988Z"
}
}
+516
View File
@@ -0,0 +1,516 @@
{
"started_at": "2026-12-02T16:30:06.791340Z",
"base_url": "http://127.0.0.1:8083",
"image": "mtusi-messenger-lab3-melnikov:local",
"profile": {
"api_replicas": 2,
"api_cpu_limit": "0.4",
"api_mem_limit": "256M"
},
"containers_before": [
{
"container_id": "e362837fa50129e33f1ee35684fb3acf1704a724b74ab974ef18c220f8ebffe4",
"name": "mtusi-lab3-melnikov-api-1",
"hostname": "e362837fa501",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "running",
"started_at": "2026-12-02T16:30:06.902037904Z",
"finished_at": "0001-01-01T00:00:00Z",
"exit_code": 0
},
{
"container_id": "1138aef4978f092197e8ae8e49c52bbcc39a1db2fa6360b238cab290f913a703",
"name": "mtusi-lab3-melnikov-api-2",
"hostname": "1138aef4978f",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "running",
"started_at": "2026-12-02T16:30:06.985683148Z",
"finished_at": "0001-01-01T00:00:00Z",
"exit_code": 0
}
],
"results": [
{
"target_instance": "e362837fa501",
"target_container": {
"container_id": "e362837fa50129e33f1ee35684fb3acf1704a724b74ab974ef18c220f8ebffe4",
"name": "mtusi-lab3-melnikov-api-1",
"image": "mtusi-messenger-lab3-melnikov:local",
"started_at_before": "2026-12-02T16:30:06.902037904Z",
"finished_at_after_stop": "2026-12-02T16:30:15.442626751Z",
"exit_code_after_stop": 0
},
"probe_elapsed_seconds": 18.182,
"loadgen": {
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:30:08.940724Z",
"finished_at": "2026-12-02T16:30:24.947429Z",
"measured_seconds": 16.001,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 62770,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3922.806,
"offered_rps": 3922.806,
"successful_latency_ms": {
"p50": 1.665,
"p95": 3.885,
"p99": 7.528,
"max": 80.514,
"mean": 2.037
},
"status_counts": {
"200": 32000,
"201": 30770
},
"instances": {
"1138aef4978f": 53628,
"e362837fa501": 9142
},
"app_versions": {
"1.0.0": 62770
},
"kinds": {
"read": 32000,
"write": 30770
},
"series": [
{
"second": 1796229008,
"success": 238,
"errors": 0,
"p50_ms": 1.614,
"p95_ms": 3.725,
"p99_ms": 4.197
},
{
"second": 1796229009,
"success": 5021,
"errors": 0,
"p50_ms": 1.336,
"p95_ms": 3.088,
"p99_ms": 3.934
},
{
"second": 1796229010,
"success": 2650,
"errors": 0,
"p50_ms": 2.673,
"p95_ms": 4.727,
"p99_ms": 15.526
},
{
"second": 1796229011,
"success": 4924,
"errors": 0,
"p50_ms": 1.305,
"p95_ms": 3.429,
"p99_ms": 5.149
},
{
"second": 1796229012,
"success": 2961,
"errors": 0,
"p50_ms": 2.572,
"p95_ms": 4.203,
"p99_ms": 5.369
},
{
"second": 1796229013,
"success": 5232,
"errors": 0,
"p50_ms": 1.225,
"p95_ms": 3.048,
"p99_ms": 4.748
},
{
"second": 1796229014,
"success": 3141,
"errors": 0,
"p50_ms": 2.354,
"p95_ms": 3.905,
"p99_ms": 7.595
},
{
"second": 1796229015,
"success": 4634,
"errors": 0,
"p50_ms": 1.265,
"p95_ms": 3.026,
"p99_ms": 15.736
},
{
"second": 1796229016,
"success": 3004,
"errors": 0,
"p50_ms": 2.51,
"p95_ms": 4.273,
"p99_ms": 6.141
},
{
"second": 1796229017,
"success": 5273,
"errors": 0,
"p50_ms": 1.108,
"p95_ms": 2.979,
"p99_ms": 9.079
},
{
"second": 1796229018,
"success": 2897,
"errors": 0,
"p50_ms": 2.352,
"p95_ms": 3.944,
"p99_ms": 9.247
},
{
"second": 1796229019,
"success": 5243,
"errors": 0,
"p50_ms": 1.105,
"p95_ms": 2.931,
"p99_ms": 6.54
},
{
"second": 1796229020,
"success": 2633,
"errors": 0,
"p50_ms": 2.69,
"p95_ms": 5.429,
"p99_ms": 11.247
},
{
"second": 1796229021,
"success": 4963,
"errors": 0,
"p50_ms": 1.2,
"p95_ms": 3.048,
"p99_ms": 6.285
},
{
"second": 1796229022,
"success": 2887,
"errors": 0,
"p50_ms": 2.613,
"p95_ms": 4.348,
"p99_ms": 6.816
},
{
"second": 1796229023,
"success": 4594,
"errors": 0,
"p50_ms": 1.085,
"p95_ms": 4.821,
"p99_ms": 13.288
},
{
"second": 1796229024,
"success": 2475,
"errors": 0,
"p50_ms": 2.841,
"p95_ms": 4.979,
"p99_ms": 6.621
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target e362837fa501; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "e362837fa501",
"stop_started_at": "2026-12-02T16:30:11.9407Z",
"stop_finished_at": "2026-12-02T16:30:15.164736Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.224,
"first_success_after_stop_seconds": 0.002,
"first_write_after_stop_seconds": 0.002,
"first_success_on_other_replica_seconds": 0.002,
"successes_after_stop": 50092,
"successes_on_other_replica_after_stop": 47289,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T16:30:13.435398Z"
}
},
"checks": {
"stop_script_exit_zero": true,
"target_container_exited": true,
"target_not_answering_after_stop": true,
"first_success_within_10s": true,
"first_write_within_10s": true,
"first_success_on_other_replica_within_10s": true,
"no_idempotency_violations": true,
"other_replica_still_running": true
},
"restore_seconds_until_lb_serves_target": 1.594,
"containers_after_stop": [
{
"container_id": "e362837fa50129e33f1ee35684fb3acf1704a724b74ab974ef18c220f8ebffe4",
"name": "mtusi-lab3-melnikov-api-1",
"hostname": "e362837fa501",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "exited",
"started_at": "2026-12-02T16:30:06.902037904Z",
"finished_at": "2026-12-02T16:30:15.442626751Z",
"exit_code": 0
},
{
"container_id": "1138aef4978f092197e8ae8e49c52bbcc39a1db2fa6360b238cab290f913a703",
"name": "mtusi-lab3-melnikov-api-2",
"hostname": "1138aef4978f",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "running",
"started_at": "2026-12-02T16:30:06.985683148Z",
"finished_at": "0001-01-01T00:00:00Z",
"exit_code": 0
}
]
},
{
"target_instance": "1138aef4978f",
"target_container": {
"container_id": "1138aef4978f092197e8ae8e49c52bbcc39a1db2fa6360b238cab290f913a703",
"name": "mtusi-lab3-melnikov-api-2",
"image": "mtusi-messenger-lab3-melnikov:local",
"started_at_before": "2026-12-02T16:30:06.985683148Z",
"finished_at_after_stop": "2026-12-02T16:30:35.255384418Z",
"exit_code_after_stop": 0
},
"probe_elapsed_seconds": 18.177,
"loadgen": {
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:30:28.743955Z",
"finished_at": "2026-12-02T16:30:44.748592Z",
"measured_seconds": 16.001,
"warmup_seconds": 2,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 63960,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3997.251,
"offered_rps": 3997.251,
"successful_latency_ms": {
"p50": 1.655,
"p95": 3.749,
"p99": 7.652,
"max": 43.545,
"mean": 1.999
},
"status_counts": {
"200": 32000,
"201": 31960
},
"instances": {
"1138aef4978f": 6980,
"e362837fa501": 56980
},
"app_versions": {
"1.0.0": 63960
},
"kinds": {
"read": 32000,
"write": 31960
},
"series": [
{
"second": 1796229028,
"success": 1020,
"errors": 0,
"p50_ms": 1.625,
"p95_ms": 4.005,
"p99_ms": 6.437
},
{
"second": 1796229029,
"success": 4836,
"errors": 0,
"p50_ms": 1.346,
"p95_ms": 3.39,
"p99_ms": 4.568
},
{
"second": 1796229030,
"success": 2209,
"errors": 0,
"p50_ms": 3.052,
"p95_ms": 7.062,
"p99_ms": 17.712
},
{
"second": 1796229031,
"success": 4392,
"errors": 0,
"p50_ms": 1.592,
"p95_ms": 3.387,
"p99_ms": 4.942
},
{
"second": 1796229032,
"success": 2894,
"errors": 0,
"p50_ms": 2.59,
"p95_ms": 4.35,
"p99_ms": 8.486
},
{
"second": 1796229033,
"success": 4807,
"errors": 0,
"p50_ms": 1.214,
"p95_ms": 3.344,
"p99_ms": 11.159
},
{
"second": 1796229034,
"success": 3172,
"errors": 0,
"p50_ms": 2.28,
"p95_ms": 4.369,
"p99_ms": 8.674
},
{
"second": 1796229035,
"success": 4558,
"errors": 0,
"p50_ms": 1.141,
"p95_ms": 3.824,
"p99_ms": 14.987
},
{
"second": 1796229036,
"success": 3400,
"errors": 0,
"p50_ms": 2.228,
"p95_ms": 3.823,
"p99_ms": 7.312
},
{
"second": 1796229037,
"success": 5285,
"errors": 0,
"p50_ms": 1.14,
"p95_ms": 2.849,
"p99_ms": 7.739
},
{
"second": 1796229038,
"success": 3244,
"errors": 0,
"p50_ms": 2.361,
"p95_ms": 3.579,
"p99_ms": 7.464
},
{
"second": 1796229039,
"success": 5066,
"errors": 0,
"p50_ms": 1.084,
"p95_ms": 3.018,
"p99_ms": 11.503
},
{
"second": 1796229040,
"success": 2805,
"errors": 0,
"p50_ms": 2.599,
"p95_ms": 4.647,
"p99_ms": 10.21
},
{
"second": 1796229041,
"success": 5362,
"errors": 0,
"p50_ms": 1.115,
"p95_ms": 3.053,
"p99_ms": 4.19
},
{
"second": 1796229042,
"success": 3156,
"errors": 0,
"p50_ms": 2.317,
"p95_ms": 4.187,
"p99_ms": 8.599
},
{
"second": 1796229043,
"success": 5268,
"errors": 0,
"p50_ms": 1.105,
"p95_ms": 2.958,
"p99_ms": 4.381
},
{
"second": 1796229044,
"success": 2486,
"errors": 0,
"p50_ms": 2.267,
"p95_ms": 3.589,
"p99_ms": 6.344
}
],
"uncertain_retries": 0,
"note": "level-4 failover matrix, target 1138aef4978f; synthetic messages created by loadgen, no retries unless -retry-uncertain",
"failover": {
"target_instance": "1138aef4978f",
"stop_started_at": "2026-12-02T16:30:31.745473Z",
"stop_finished_at": "2026-12-02T16:30:35.006491Z",
"stop_script_exit": 0,
"stop_duration_seconds": 3.26,
"first_success_after_stop_seconds": 0.003,
"first_write_after_stop_seconds": 0.207,
"first_success_on_other_replica_seconds": 0.003,
"successes_after_stop": 52709,
"successes_on_other_replica_after_stop": 51355,
"errors_after_stop": 0,
"target_responses_after_stop": 0,
"target_last_response_at": "2026-12-02T16:30:32.52988Z"
}
},
"checks": {
"stop_script_exit_zero": true,
"target_container_exited": true,
"target_not_answering_after_stop": true,
"first_success_within_10s": true,
"first_write_within_10s": true,
"first_success_on_other_replica_within_10s": true,
"no_idempotency_violations": true,
"other_replica_still_running": true
},
"restore_seconds_until_lb_serves_target": 0.612,
"containers_after_stop": [
{
"container_id": "e362837fa50129e33f1ee35684fb3acf1704a724b74ab974ef18c220f8ebffe4",
"name": "mtusi-lab3-melnikov-api-1",
"hostname": "e362837fa501",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "running",
"started_at": "2026-12-02T16:30:25.394086979Z",
"finished_at": "2026-12-02T16:30:15.442626751Z",
"exit_code": 0
},
{
"container_id": "1138aef4978f092197e8ae8e49c52bbcc39a1db2fa6360b238cab290f913a703",
"name": "mtusi-lab3-melnikov-api-2",
"hostname": "1138aef4978f",
"image": "mtusi-messenger-lab3-melnikov:local",
"state": "exited",
"started_at": "2026-12-02T16:30:06.985683148Z",
"finished_at": "2026-12-02T16:30:35.255384418Z",
"exit_code": 0
}
]
}
],
"finished_at": "2026-12-02T16:30:45.430501Z",
"all_checks_passed": true
}
+83
View File
@@ -0,0 +1,83 @@
{
"checked_at": "2026-12-02T16:29:19.821754Z",
"base_url": "http://127.0.0.1:8083",
"initial_message": "421461ed-c75a-49a3-ae9f-a39ff0478b18",
"outages": [
{
"dependency": "postgres",
"container": "3a14f105548e8c54701372e933e0fc1ceda8caaa89e274becd0977cd1e87f8d8",
"stopped_at": "2026-12-02T16:29:21.356415Z",
"stop_seconds": 0.085,
"direct_live_status": 200,
"direct_live_body": {
"status": "ok"
},
"direct_ready_status": 503,
"direct_ready_code": null,
"direct_protected_status": 503,
"direct_protected_code": null,
"direct_anonymous_status": 401,
"direct_login_status": 503,
"direct_login_code": null,
"direct_write_status": 503,
"direct_write_code": null,
"lb_live_status_during_outage": 200,
"lb_live_instance_header": "fdf38eb6b74b",
"lb_ready_status_during_outage": 503,
"lb_ready_instance_header": "fdf38eb6b74b",
"recovery_seconds_to_ready": 5.411,
"restored_at": "2026-12-02T16:29:27.153858Z",
"same_token_user_id": "7a14bd29-7a05-4561-a127-d838cae65d0e",
"same_token": true,
"history_items": 1,
"volumes_before": [
"mtusi-lab3-melnikov-pgdata",
"mtusi-lab3-melnikov-valkeydata"
],
"volumes_after": [
"mtusi-lab3-melnikov-pgdata",
"mtusi-lab3-melnikov-valkeydata"
],
"volumes_preserved": true
},
{
"dependency": "valkey",
"container": "3bf366f49d04ebb913511c31a03f94296694aa0740d8ad96790dc34c7029c68e",
"stopped_at": "2026-12-02T16:29:29.865134Z",
"stop_seconds": 0.097,
"direct_live_status": 200,
"direct_live_body": {
"status": "ok"
},
"direct_ready_status": 503,
"direct_ready_code": null,
"direct_protected_status": 503,
"direct_protected_code": null,
"direct_anonymous_status": 401,
"direct_login_status": 503,
"direct_login_code": null,
"direct_write_status": 503,
"direct_write_code": null,
"lb_live_status_during_outage": 503,
"lb_live_instance_header": null,
"lb_ready_status_during_outage": 503,
"lb_ready_instance_header": null,
"recovery_seconds_to_ready": 5.385,
"restored_at": "2026-12-02T16:29:35.738133Z",
"same_token_user_id": "7a14bd29-7a05-4561-a127-d838cae65d0e",
"same_token": true,
"history_items": 1,
"volumes_before": [
"mtusi-lab3-melnikov-pgdata",
"mtusi-lab3-melnikov-valkeydata"
],
"volumes_after": [
"mtusi-lab3-melnikov-pgdata",
"mtusi-lab3-melnikov-valkeydata"
],
"volumes_preserved": true,
"counts_unchanged": true
}
],
"result": "PASS"
}
+4
View File
@@ -0,0 +1,4 @@
python3 scripts/failure-checks.py --base-url "http://127.0.0.1:8083"
postgres: direct live=200 ready=503 protected=503 login=503 write=503; LB live=200 ready=503; recovery 5.411s; volumes preserved=True
valkey: direct live=200 ready=503 protected=503 login=503 write=503; LB live=503 ready=503; recovery 5.385s; volumes preserved=True
PASS: dependency outages produced bounded 503, then recovered with the same token
+2
View File
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "http://127.0.0.1:8083"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
+31
View File
@@ -0,0 +1,31 @@
Lab3 final verification
=======================
timestamp_utc: 2026-12-02T16:38:47Z
branch: solution/bvt2301-melnikov
head_before_final_docs_commit: deca60c85900d4b74f99c377f7e161f573af979b
worktree_status_lines_before_this_file: 0 after H1 commit
image: mtusi-messenger-lab3-melnikov:local
image_id: sha256:c999351dd1ef2d2199d0bfeb73f057d80cee077afef267e97c3de9a10ef7ed48
api_containers:
mtusi-lab3-melnikov-api-2 mtusi-messenger-lab3-melnikov:local Up 31 seconds (healthy)
mtusi-lab3-melnikov-api-1 mtusi-messenger-lab3-melnikov:local Up 31 seconds (healthy)
Commands and results:
make test PASS (public smoke through LB 127.0.0.1:8083)
make test-student PASS (Go tests + 141 black-box checks)
make failover-each PASS (2 distinct API containers stopped/restored, 0 errors)
make test-container PASS (limits, no API host ports, no container_name, shared session)
make test-db PASS (migrations 1,2,3; 509k messages/idempotency; 0 duplicates/orphans; Argon2id)
make test-failure PASS (direct live 200, ready/protected/login/write 503, LB exclusion, recovery 5.4 s)
make rolling PASS (183848 requests, 0 errors, both 1.0.0/2.0.0 versions, migrate no-op)
scripts/track1.py PASS (24 runs; see evidence/track1/summary.json)
scripts/clean-clone-check.sh PASS (users=0, migrations=1,2,3; public/student/persistence; purge clean)
Track 1 medians (fixed total API 0.8 vCPU / 512 MiB):
1 replica: 1228.8 RPS, DB util 0.960, pool waits 0.997
2 replicas: 1542.0 RPS, DB util 0.978, pool waits 0.900
4 replicas: 1585.9 RPS, DB util 0.982, pool waits 0.159
improvement (one atomic CTE vs baseline): +46.9% RPS median (paired +96.1/+48.3/+9.1%)
Clean clone source revision: 1a7f31e7e5ee25e5f34b7b851d068c5cce77ed43 (H1 differs only in docs/evidence)
Main stand after clean-clone check: two api-1/api-2 local-image containers serving; same named volumes.
+13
View File
@@ -0,0 +1,13 @@
== go-race (2026-12-02T16:25:07Z) ==
? mtusi.ru/messenger-lab3/cmd/loadgen [no test files]
? mtusi.ru/messenger-lab3/cmd/messenger [no test files]
? mtusi.ru/messenger-lab3/cmd/migrate [no test files]
ok mtusi.ru/messenger-lab3/internal/api 1.172s
ok mtusi.ru/messenger-lab3/internal/auth 4.426s
ok mtusi.ru/messenger-lab3/internal/config 1.287s
ok mtusi.ru/messenger-lab3/internal/cursor 1.531s
ok mtusi.ru/messenger-lab3/internal/model 1.408s
? mtusi.ru/messenger-lab3/internal/session [no test files]
ok mtusi.ru/messenger-lab3/internal/store 1.789s
ok mtusi.ru/messenger-lab3/internal/uuid 1.913s
exit_code: 0
+13
View File
@@ -0,0 +1,13 @@
== go-tests (2026-12-02T16:25:05Z) ==
? mtusi.ru/messenger-lab3/cmd/loadgen [no test files]
? mtusi.ru/messenger-lab3/cmd/messenger [no test files]
? mtusi.ru/messenger-lab3/cmd/migrate [no test files]
ok mtusi.ru/messenger-lab3/internal/api 0.697s
ok mtusi.ru/messenger-lab3/internal/auth 1.175s
ok mtusi.ru/messenger-lab3/internal/config 0.563s
ok mtusi.ru/messenger-lab3/internal/cursor 1.089s
ok mtusi.ru/messenger-lab3/internal/model 0.325s
? mtusi.ru/messenger-lab3/internal/session [no test files]
ok mtusi.ru/messenger-lab3/internal/store 0.972s
ok mtusi.ru/messenger-lab3/internal/uuid 0.442s
exit_code: 0
+2
View File
@@ -0,0 +1,2 @@
== go-vet (2026-12-02T16:25:07Z) ==
exit_code: 0
+5
View File
@@ -0,0 +1,5 @@
== persistence (2026-12-02T16:25:34Z) ==
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1:8083"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
exit_code: 0
+6
View File
@@ -0,0 +1,6 @@
== public-failover (2026-12-02T16:25:19Z) ==
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://127.0.0.1:8083"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 136, "failed_attempts": 0, "first_recovery_seconds": 3.42}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
exit_code: 0
+4
View File
@@ -0,0 +1,4 @@
== public-smoke (2026-12-02T16:25:12Z) ==
python3 tests/smoke.py --base-url "http://127.0.0.1:8083"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
exit_code: 0
+18
View File
@@ -0,0 +1,18 @@
== python39 (2026-12-02T16:25:16Z) ==
Python 3.9.6
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
PASS health
PASS registration/auth
PASS registration validation
PASS chats/membership
PASS messages
PASS instances (2 observed)
PASS idempotency replay/conflict/scope/validation
PASS concurrent idempotency across 2 replicas
PASS pagination
PASS concurrent registration
PASS concurrent messages
PASS logout
PASS: lab3 student black-box suite, 141 checks
exit_code: 0
+455
View File
@@ -0,0 +1,455 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:31:09.595708Z",
"finished_at": "2026-12-02T16:31:59.597789Z",
"measured_seconds": 50.002,
"warmup_seconds": 3,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 183848,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3676.801,
"offered_rps": 3676.801,
"successful_latency_ms": {
"p50": 1.837,
"p95": 4.294,
"p99": 7.552,
"max": 52.419,
"mean": 2.173
},
"status_counts": {
"200": 92000,
"201": 91848
},
"instances": {
"4497d9762b3a": 86480,
"5d0994ded47c": 6311,
"bbe0caea5403": 64547,
"bf20ca3ea992": 26510
},
"app_versions": {
"1.0.0": 32821,
"2.0.0": 151027
},
"kinds": {
"read": 92000,
"write": 91848
},
"series": [
{
"second": 1796229069,
"success": 866,
"errors": 0,
"p50_ms": 3.288,
"p95_ms": 5.65,
"p99_ms": 17.979
},
{
"second": 1796229070,
"success": 3650,
"errors": 0,
"p50_ms": 1.971,
"p95_ms": 3.646,
"p99_ms": 5.223
},
{
"second": 1796229071,
"success": 3628,
"errors": 0,
"p50_ms": 1.715,
"p95_ms": 5.009,
"p99_ms": 7.222
},
{
"second": 1796229072,
"success": 2289,
"errors": 0,
"p50_ms": 3.187,
"p95_ms": 6.267,
"p99_ms": 8.755
},
{
"second": 1796229073,
"success": 4998,
"errors": 0,
"p50_ms": 1.2,
"p95_ms": 3.331,
"p99_ms": 5.71
},
{
"second": 1796229074,
"success": 2666,
"errors": 0,
"p50_ms": 2.577,
"p95_ms": 5.416,
"p99_ms": 12.841
},
{
"second": 1796229075,
"success": 3324,
"errors": 0,
"p50_ms": 1.62,
"p95_ms": 6.731,
"p99_ms": 12.42
},
{
"second": 1796229076,
"success": 3577,
"errors": 0,
"p50_ms": 1.831,
"p95_ms": 4.448,
"p99_ms": 12.543
},
{
"second": 1796229077,
"success": 2978,
"errors": 0,
"p50_ms": 2.457,
"p95_ms": 5.895,
"p99_ms": 8.819
},
{
"second": 1796229078,
"success": 4494,
"errors": 0,
"p50_ms": 1.347,
"p95_ms": 3.607,
"p99_ms": 5.543
},
{
"second": 1796229079,
"success": 2591,
"errors": 0,
"p50_ms": 2.799,
"p95_ms": 5.092,
"p99_ms": 12.227
},
{
"second": 1796229080,
"success": 4989,
"errors": 0,
"p50_ms": 1.293,
"p95_ms": 3.317,
"p99_ms": 4.527
},
{
"second": 1796229081,
"success": 3271,
"errors": 0,
"p50_ms": 2.453,
"p95_ms": 3.752,
"p99_ms": 4.914
},
{
"second": 1796229082,
"success": 4908,
"errors": 0,
"p50_ms": 1.156,
"p95_ms": 3.039,
"p99_ms": 9.356
},
{
"second": 1796229083,
"success": 3455,
"errors": 0,
"p50_ms": 2.201,
"p95_ms": 3.839,
"p99_ms": 5.725
},
{
"second": 1796229084,
"success": 4161,
"errors": 0,
"p50_ms": 1.489,
"p95_ms": 3.852,
"p99_ms": 8.727
},
{
"second": 1796229085,
"success": 2957,
"errors": 0,
"p50_ms": 2.509,
"p95_ms": 4.09,
"p99_ms": 9.55
},
{
"second": 1796229086,
"success": 5200,
"errors": 0,
"p50_ms": 1.256,
"p95_ms": 3.08,
"p99_ms": 4.029
},
{
"second": 1796229087,
"success": 3126,
"errors": 0,
"p50_ms": 2.489,
"p95_ms": 3.948,
"p99_ms": 5.299
},
{
"second": 1796229088,
"success": 4984,
"errors": 0,
"p50_ms": 1.246,
"p95_ms": 3.164,
"p99_ms": 4.996
},
{
"second": 1796229089,
"success": 2555,
"errors": 0,
"p50_ms": 2.754,
"p95_ms": 5.209,
"p99_ms": 16.823
},
{
"second": 1796229090,
"success": 5039,
"errors": 0,
"p50_ms": 1.285,
"p95_ms": 3.253,
"p99_ms": 5.059
},
{
"second": 1796229091,
"success": 3066,
"errors": 0,
"p50_ms": 2.506,
"p95_ms": 4.009,
"p99_ms": 5.363
},
{
"second": 1796229092,
"success": 4943,
"errors": 0,
"p50_ms": 1.313,
"p95_ms": 3.433,
"p99_ms": 4.618
},
{
"second": 1796229093,
"success": 2907,
"errors": 0,
"p50_ms": 2.642,
"p95_ms": 4.141,
"p99_ms": 6.129
},
{
"second": 1796229094,
"success": 4359,
"errors": 0,
"p50_ms": 1.472,
"p95_ms": 3.683,
"p99_ms": 7.289
},
{
"second": 1796229095,
"success": 3059,
"errors": 0,
"p50_ms": 2.519,
"p95_ms": 4.025,
"p99_ms": 5.126
},
{
"second": 1796229096,
"success": 5211,
"errors": 0,
"p50_ms": 1.241,
"p95_ms": 3.036,
"p99_ms": 4.057
},
{
"second": 1796229097,
"success": 3073,
"errors": 0,
"p50_ms": 2.465,
"p95_ms": 4.145,
"p99_ms": 6.405
},
{
"second": 1796229098,
"success": 5159,
"errors": 0,
"p50_ms": 1.27,
"p95_ms": 3.227,
"p99_ms": 4.124
},
{
"second": 1796229099,
"success": 2690,
"errors": 0,
"p50_ms": 2.629,
"p95_ms": 5.014,
"p99_ms": 15.406
},
{
"second": 1796229100,
"success": 5100,
"errors": 0,
"p50_ms": 1.261,
"p95_ms": 3.253,
"p99_ms": 4.503
},
{
"second": 1796229101,
"success": 3017,
"errors": 0,
"p50_ms": 2.493,
"p95_ms": 4.058,
"p99_ms": 6.264
},
{
"second": 1796229102,
"success": 5223,
"errors": 0,
"p50_ms": 1.204,
"p95_ms": 3.167,
"p99_ms": 4.182
},
{
"second": 1796229103,
"success": 3049,
"errors": 0,
"p50_ms": 2.514,
"p95_ms": 4.039,
"p99_ms": 6.177
},
{
"second": 1796229104,
"success": 4622,
"errors": 0,
"p50_ms": 1.385,
"p95_ms": 3.372,
"p99_ms": 5.717
},
{
"second": 1796229105,
"success": 3129,
"errors": 0,
"p50_ms": 2.45,
"p95_ms": 3.829,
"p99_ms": 5.236
},
{
"second": 1796229106,
"success": 3247,
"errors": 0,
"p50_ms": 2.057,
"p95_ms": 5.146,
"p99_ms": 8.179
},
{
"second": 1796229107,
"success": 3763,
"errors": 0,
"p50_ms": 2.03,
"p95_ms": 3.92,
"p99_ms": 5.351
},
{
"second": 1796229108,
"success": 4747,
"errors": 0,
"p50_ms": 1.354,
"p95_ms": 3.241,
"p99_ms": 4.947
},
{
"second": 1796229109,
"success": 1832,
"errors": 0,
"p50_ms": 3.144,
"p95_ms": 12.348,
"p99_ms": 21.878
},
{
"second": 1796229110,
"success": 2178,
"errors": 0,
"p50_ms": 3.079,
"p95_ms": 7.596,
"p99_ms": 13.984
},
{
"second": 1796229111,
"success": 4174,
"errors": 0,
"p50_ms": 1.378,
"p95_ms": 4.424,
"p99_ms": 5.97
},
{
"second": 1796229112,
"success": 2517,
"errors": 0,
"p50_ms": 2.904,
"p95_ms": 5.882,
"p99_ms": 7.563
},
{
"second": 1796229113,
"success": 3654,
"errors": 0,
"p50_ms": 2.057,
"p95_ms": 3.969,
"p99_ms": 5.194
},
{
"second": 1796229114,
"success": 3415,
"errors": 0,
"p50_ms": 1.447,
"p95_ms": 6.27,
"p99_ms": 12.713
},
{
"second": 1796229115,
"success": 2070,
"errors": 0,
"p50_ms": 3.466,
"p95_ms": 7.515,
"p99_ms": 10.036
},
{
"second": 1796229116,
"success": 3673,
"errors": 0,
"p50_ms": 1.682,
"p95_ms": 4.693,
"p99_ms": 6.322
},
{
"second": 1796229117,
"success": 3659,
"errors": 0,
"p50_ms": 2.1,
"p95_ms": 3.972,
"p99_ms": 5.418
},
{
"second": 1796229118,
"success": 4170,
"errors": 0,
"p50_ms": 1.541,
"p95_ms": 3.41,
"p99_ms": 4.971
},
{
"second": 1796229119,
"success": 2436,
"errors": 0,
"p50_ms": 1.337,
"p95_ms": 4.575,
"p99_ms": 7.037
}
],
"uncertain_retries": 0,
"note": "rolling update 1.0.0 -\u003e 2.0.0; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+455
View File
@@ -0,0 +1,455 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:31:09.595708Z",
"finished_at": "2026-12-02T16:31:59.597789Z",
"measured_seconds": 50.002,
"warmup_seconds": 3,
"concurrency": 8,
"rate_limit_per_second": 0,
"read_ratio": 0.5,
"retry_uncertain": true,
"profile": "closed-loop",
"successful_requests": 183848,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 3676.801,
"offered_rps": 3676.801,
"successful_latency_ms": {
"p50": 1.837,
"p95": 4.294,
"p99": 7.552,
"max": 52.419,
"mean": 2.173
},
"status_counts": {
"200": 92000,
"201": 91848
},
"instances": {
"4497d9762b3a": 86480,
"5d0994ded47c": 6311,
"bbe0caea5403": 64547,
"bf20ca3ea992": 26510
},
"app_versions": {
"1.0.0": 32821,
"2.0.0": 151027
},
"kinds": {
"read": 92000,
"write": 91848
},
"series": [
{
"second": 1796229069,
"success": 866,
"errors": 0,
"p50_ms": 3.288,
"p95_ms": 5.65,
"p99_ms": 17.979
},
{
"second": 1796229070,
"success": 3650,
"errors": 0,
"p50_ms": 1.971,
"p95_ms": 3.646,
"p99_ms": 5.223
},
{
"second": 1796229071,
"success": 3628,
"errors": 0,
"p50_ms": 1.715,
"p95_ms": 5.009,
"p99_ms": 7.222
},
{
"second": 1796229072,
"success": 2289,
"errors": 0,
"p50_ms": 3.187,
"p95_ms": 6.267,
"p99_ms": 8.755
},
{
"second": 1796229073,
"success": 4998,
"errors": 0,
"p50_ms": 1.2,
"p95_ms": 3.331,
"p99_ms": 5.71
},
{
"second": 1796229074,
"success": 2666,
"errors": 0,
"p50_ms": 2.577,
"p95_ms": 5.416,
"p99_ms": 12.841
},
{
"second": 1796229075,
"success": 3324,
"errors": 0,
"p50_ms": 1.62,
"p95_ms": 6.731,
"p99_ms": 12.42
},
{
"second": 1796229076,
"success": 3577,
"errors": 0,
"p50_ms": 1.831,
"p95_ms": 4.448,
"p99_ms": 12.543
},
{
"second": 1796229077,
"success": 2978,
"errors": 0,
"p50_ms": 2.457,
"p95_ms": 5.895,
"p99_ms": 8.819
},
{
"second": 1796229078,
"success": 4494,
"errors": 0,
"p50_ms": 1.347,
"p95_ms": 3.607,
"p99_ms": 5.543
},
{
"second": 1796229079,
"success": 2591,
"errors": 0,
"p50_ms": 2.799,
"p95_ms": 5.092,
"p99_ms": 12.227
},
{
"second": 1796229080,
"success": 4989,
"errors": 0,
"p50_ms": 1.293,
"p95_ms": 3.317,
"p99_ms": 4.527
},
{
"second": 1796229081,
"success": 3271,
"errors": 0,
"p50_ms": 2.453,
"p95_ms": 3.752,
"p99_ms": 4.914
},
{
"second": 1796229082,
"success": 4908,
"errors": 0,
"p50_ms": 1.156,
"p95_ms": 3.039,
"p99_ms": 9.356
},
{
"second": 1796229083,
"success": 3455,
"errors": 0,
"p50_ms": 2.201,
"p95_ms": 3.839,
"p99_ms": 5.725
},
{
"second": 1796229084,
"success": 4161,
"errors": 0,
"p50_ms": 1.489,
"p95_ms": 3.852,
"p99_ms": 8.727
},
{
"second": 1796229085,
"success": 2957,
"errors": 0,
"p50_ms": 2.509,
"p95_ms": 4.09,
"p99_ms": 9.55
},
{
"second": 1796229086,
"success": 5200,
"errors": 0,
"p50_ms": 1.256,
"p95_ms": 3.08,
"p99_ms": 4.029
},
{
"second": 1796229087,
"success": 3126,
"errors": 0,
"p50_ms": 2.489,
"p95_ms": 3.948,
"p99_ms": 5.299
},
{
"second": 1796229088,
"success": 4984,
"errors": 0,
"p50_ms": 1.246,
"p95_ms": 3.164,
"p99_ms": 4.996
},
{
"second": 1796229089,
"success": 2555,
"errors": 0,
"p50_ms": 2.754,
"p95_ms": 5.209,
"p99_ms": 16.823
},
{
"second": 1796229090,
"success": 5039,
"errors": 0,
"p50_ms": 1.285,
"p95_ms": 3.253,
"p99_ms": 5.059
},
{
"second": 1796229091,
"success": 3066,
"errors": 0,
"p50_ms": 2.506,
"p95_ms": 4.009,
"p99_ms": 5.363
},
{
"second": 1796229092,
"success": 4943,
"errors": 0,
"p50_ms": 1.313,
"p95_ms": 3.433,
"p99_ms": 4.618
},
{
"second": 1796229093,
"success": 2907,
"errors": 0,
"p50_ms": 2.642,
"p95_ms": 4.141,
"p99_ms": 6.129
},
{
"second": 1796229094,
"success": 4359,
"errors": 0,
"p50_ms": 1.472,
"p95_ms": 3.683,
"p99_ms": 7.289
},
{
"second": 1796229095,
"success": 3059,
"errors": 0,
"p50_ms": 2.519,
"p95_ms": 4.025,
"p99_ms": 5.126
},
{
"second": 1796229096,
"success": 5211,
"errors": 0,
"p50_ms": 1.241,
"p95_ms": 3.036,
"p99_ms": 4.057
},
{
"second": 1796229097,
"success": 3073,
"errors": 0,
"p50_ms": 2.465,
"p95_ms": 4.145,
"p99_ms": 6.405
},
{
"second": 1796229098,
"success": 5159,
"errors": 0,
"p50_ms": 1.27,
"p95_ms": 3.227,
"p99_ms": 4.124
},
{
"second": 1796229099,
"success": 2690,
"errors": 0,
"p50_ms": 2.629,
"p95_ms": 5.014,
"p99_ms": 15.406
},
{
"second": 1796229100,
"success": 5100,
"errors": 0,
"p50_ms": 1.261,
"p95_ms": 3.253,
"p99_ms": 4.503
},
{
"second": 1796229101,
"success": 3017,
"errors": 0,
"p50_ms": 2.493,
"p95_ms": 4.058,
"p99_ms": 6.264
},
{
"second": 1796229102,
"success": 5223,
"errors": 0,
"p50_ms": 1.204,
"p95_ms": 3.167,
"p99_ms": 4.182
},
{
"second": 1796229103,
"success": 3049,
"errors": 0,
"p50_ms": 2.514,
"p95_ms": 4.039,
"p99_ms": 6.177
},
{
"second": 1796229104,
"success": 4622,
"errors": 0,
"p50_ms": 1.385,
"p95_ms": 3.372,
"p99_ms": 5.717
},
{
"second": 1796229105,
"success": 3129,
"errors": 0,
"p50_ms": 2.45,
"p95_ms": 3.829,
"p99_ms": 5.236
},
{
"second": 1796229106,
"success": 3247,
"errors": 0,
"p50_ms": 2.057,
"p95_ms": 5.146,
"p99_ms": 8.179
},
{
"second": 1796229107,
"success": 3763,
"errors": 0,
"p50_ms": 2.03,
"p95_ms": 3.92,
"p99_ms": 5.351
},
{
"second": 1796229108,
"success": 4747,
"errors": 0,
"p50_ms": 1.354,
"p95_ms": 3.241,
"p99_ms": 4.947
},
{
"second": 1796229109,
"success": 1832,
"errors": 0,
"p50_ms": 3.144,
"p95_ms": 12.348,
"p99_ms": 21.878
},
{
"second": 1796229110,
"success": 2178,
"errors": 0,
"p50_ms": 3.079,
"p95_ms": 7.596,
"p99_ms": 13.984
},
{
"second": 1796229111,
"success": 4174,
"errors": 0,
"p50_ms": 1.378,
"p95_ms": 4.424,
"p99_ms": 5.97
},
{
"second": 1796229112,
"success": 2517,
"errors": 0,
"p50_ms": 2.904,
"p95_ms": 5.882,
"p99_ms": 7.563
},
{
"second": 1796229113,
"success": 3654,
"errors": 0,
"p50_ms": 2.057,
"p95_ms": 3.969,
"p99_ms": 5.194
},
{
"second": 1796229114,
"success": 3415,
"errors": 0,
"p50_ms": 1.447,
"p95_ms": 6.27,
"p99_ms": 12.713
},
{
"second": 1796229115,
"success": 2070,
"errors": 0,
"p50_ms": 3.466,
"p95_ms": 7.515,
"p99_ms": 10.036
},
{
"second": 1796229116,
"success": 3673,
"errors": 0,
"p50_ms": 1.682,
"p95_ms": 4.693,
"p99_ms": 6.322
},
{
"second": 1796229117,
"success": 3659,
"errors": 0,
"p50_ms": 2.1,
"p95_ms": 3.972,
"p99_ms": 5.418
},
{
"second": 1796229118,
"success": 4170,
"errors": 0,
"p50_ms": 1.541,
"p95_ms": 3.41,
"p99_ms": 4.971
},
{
"second": 1796229119,
"success": 2436,
"errors": 0,
"p50_ms": 1.337,
"p95_ms": 4.575,
"p99_ms": 7.037
}
],
"uncertain_retries": 0,
"note": "rolling update 1.0.0 -\u003e 2.0.0; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+3
View File
@@ -0,0 +1,3 @@
Container mtusi-lab3-melnikov-postgres-1 Running
time=2026-12-02T16:31:12.346Z level=INFO msg="migrations complete" service=messenger-lab3-migrate revision=922a38b2cf98f3e0b79fd605a21e42fc30ff1028 elapsed_ms=3.709
migrations: up-to-date
+10
View File
@@ -0,0 +1,10 @@
rolling update proof
old image: mtusi-messenger-lab3-melnikov:local sha256:c999351dd1ef2d2199d0bfeb73f057d80cee077afef267e97c3de9a10ef7ed48
new image: mtusi-messenger-lab3-melnikov:rolling sha256:7b7cf471e2f553b511641f5fb292fb35249a29d77067a0a8402aa6e7ee69c2c7
versions observed in probe: {"1.0.0": 32821, "2.0.0": 151027}
instances observed: {"4497d9762b3a": 86480, "5d0994ded47c": 6311, "bbe0caea5403": 64547, "bf20ca3ea992": 26510}
requests: 183848, failures: 0, RPS: 3676.8, p95: 4.3 ms
migration: no-op, 3.709 ms, schema 1,2,3 before/after
final containers:
/mtusi-lab3-melnikov-api-3 sha256:7b7cf471e2f553b511641f5fb292fb35249a29d77067a0a8402aa6e7ee69c2c7 running 2026-12-02T16:31:24.574895212Z
/mtusi-lab3-melnikov-api-2 sha256:7b7cf471e2f553b511641f5fb292fb35249a29d77067a0a8402aa6e7ee69c2c7 running 2026-12-02T16:31:15.720276227Z
+54
View File
@@ -0,0 +1,54 @@
{
"started_at": "2026-12-02T16:31:09.595708Z",
"finished_at": "2026-12-02T16:31:59.597789Z",
"old_image": {
"tag": "mtusi-messenger-lab3-melnikov:local",
"id": "sha256:c999351dd1ef2d2199d0bfeb73f057d80cee077afef267e97c3de9a10ef7ed48",
"version": "1.0.0"
},
"new_image": {
"tag": "mtusi-messenger-lab3-melnikov:rolling",
"id": "sha256:7b7cf471e2f553b511641f5fb292fb35249a29d77067a0a8402aa6e7ee69c2c7",
"version": "2.0.0"
},
"migration": {
"command": "docker compose run --rm migrate (new image)",
"result": "migrations: up-to-date",
"schema_versions_before_after": "1,2,3",
"elapsed_ms": 3.709,
"note": "no schema change between these revisions; old replicas kept serving during the no-op migration"
},
"probe": {
"requests": 183848,
"successful": 183848,
"failed": 0,
"error_ratio": 0,
"successful_rps": 3676.801,
"p50_ms": 1.837,
"p95_ms": 4.294,
"p99_ms": 7.552
},
"app_versions_observed": {
"1.0.0": 32821,
"2.0.0": 151027
},
"instances_observed": {
"4497d9762b3a": 86480,
"5d0994ded47c": 6311,
"bbe0caea5403": 64547,
"bf20ca3ea992": 26510
},
"idempotency_violations": [],
"replacement_steps": 2,
"final_api_images": [
"sha256:7b7cf471e2f553b511641f5fb292fb35249a29d77067a0a8402aa6e7ee69c2c7"
],
"checks": {
"zero_failed_requests": true,
"both_versions_observed": true,
"all_final_containers_new_image": true,
"no_idempotency_violations": true
},
"collected_at": "2026-12-02T16:32:20.964831Z",
"note": "Derived summary of evidence/rolling-update/loadgen.json and migrate.txt; raw files remain authoritative."
}
+28
View File
@@ -0,0 +1,28 @@
== student-tests (2026-12-02T16:25:12Z) ==
go test -count=1 ./...
? mtusi.ru/messenger-lab3/cmd/loadgen [no test files]
? mtusi.ru/messenger-lab3/cmd/messenger [no test files]
? mtusi.ru/messenger-lab3/cmd/migrate [no test files]
ok mtusi.ru/messenger-lab3/internal/api 0.399s
ok mtusi.ru/messenger-lab3/internal/auth 0.973s
ok mtusi.ru/messenger-lab3/internal/config 0.275s
ok mtusi.ru/messenger-lab3/internal/cursor 0.523s
ok mtusi.ru/messenger-lab3/internal/model 0.933s
? mtusi.ru/messenger-lab3/internal/session [no test files]
ok mtusi.ru/messenger-lab3/internal/store 0.143s
ok mtusi.ru/messenger-lab3/internal/uuid 0.780s
python3 student-tests/blackbox.py --base-url "http://127.0.0.1:8083"
PASS health
PASS registration/auth
PASS registration validation
PASS chats/membership
PASS messages
PASS instances (2 observed)
PASS idempotency replay/conflict/scope/validation
PASS concurrent idempotency across 2 replicas
PASS pagination
PASS concurrent registration
PASS concurrent messages
PASS logout
PASS: lab3 student black-box suite, 141 checks
exit_code: 0
+63
View File
@@ -0,0 +1,63 @@
# Track 1 methodology: price of scaling
## Hypothesis
At a fixed total API CPU/RAM budget, adding API replicas raises HTTP
acknowledgement throughput only until a shared component saturates. On this
single Docker host the candidate shared bottlenecks are PostgreSQL CPU/WAL,
the pgx pool, HAProxy and the 2-vCPU VM itself. Once DB CPU is throttled, more
replicas add contention rather than throughput. Folding the message insert and
the idempotency record into one atomic statement should reduce DB work per
acknowledged message and raise throughput at the same limits.
## Fixed profile
* Load: closed-loop POST /api/v1/chats/{id}/messages through the LB, unique
Idempotency-Key and unique text per request, 32 Go workers,
5 s warmup, 20 s measured.
* Total API budget: 0.8 vCPU and 512 MiB, split 1x0.8 / 2x0.4 / 4x0.2 and
1x512M / 2x256M / 4x128M. PostgreSQL, Valkey and HAProxy limits are fixed.
* The whole stand runs on one Colima VM with 2 vCPU and 2 GiB RAM. The sum of
CPU limits is 1.8 cores in the fixed profile and 1.9 in the growth profile.
These are process-level replicas on one kernel, not independent nodes.
## Resource-growth series
At 4 replicas, total API CPU grows 0.4 -> 0.7 -> 0.9 vCPU (0.1/0.175/0.225 per
replica), RAM stays 512 MiB total, DB/Valkey/LB limits stay fixed. This
separates "HTTP capacity is the limit" from "shared DB is the limit".
## Improvement
At the saturated 4x0.2 profile the baseline image uses an explicit transaction,
a message INSERT and an idempotency INSERT (three SQL statements plus
BEGIN/COMMIT). The final image uses one data-modifying CTE that inserts the
message and the idempotency row atomically; a concurrent unique conflict aborts
the whole statement and is replayed. The client, profile and limits are
identical. Reported improvement is the median of 3 alternating runs.
## Metric sources and units
| Field | Source | Unit / meaning |
| --- | --- | --- |
| successful_rps | loadgen JSON | HTTP 2xx acknowledgements / measured seconds; not COMMIT count |
| successful_latency_ms | loadgen JSON | per-request wall time for successful requests, p50/p95/p99 |
| api_used_cores | cgroup v2 cpu.stat usage_usec delta / window | cores actually consumed by all API containers |
| api_throttled_seconds | cgroup v2 throttled_usec delta | CPU throttling, not load average |
| db_used_cores | cgroup v2 cpu.stat of PostgreSQL | cores consumed by the DB container |
| db_throttled_seconds | cgroup v2 throttled_usec of PostgreSQL | evidence of the DB CPU quota being hit |
| commits_per_second | pg_stat_database.xact_commit delta / window | DB transactions, includes auth/chat metadata |
| pool_waits_per_acquire | pgxpool.Stat EmptyAcquireCount delta / AcquireCount delta | fraction of pool acquisitions that had to wait |
| lb_qmax, lb_5xx | HAProxy stats CSV | queue maximum and 5xx on the public frontend |
| buffer_hit_ratio | pg_stat_database blks_hit/(hit+read) | shared-buffer locality |
| memory | cgroup v2 memory.current | cgroup working set, not process RSS |
## Limitations
* One Docker VM and one DB instance: no node failover, no DB replication.
* Closed-loop load has coordinated omission; the loadgen reports only
successful-request latency and separately counts failures.
* The load generator and the stack share the same 2-vCPU host; client cost is
visible and is part of the measured system.
* Absolute RPS is local and is not a production SLA.
+47
View File
@@ -0,0 +1,47 @@
<line x1="90" y1="480.0" x2="920" y2="480.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="484.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">0.0</text>
<line x1="90" y1="402.0" x2="920" y2="402.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="406.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">40.0</text>
<line x1="90" y1="324.0" x2="920" y2="324.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="328.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">80.0</text>
<line x1="90" y1="246.0" x2="920" y2="246.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="250.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">120.0</text>
<line x1="90" y1="168.0" x2="920" y2="168.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="172.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">160.0</text>
<line x1="90" y1="90.0" x2="920" y2="90.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="94.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">200.0</text>
<line x1="90" y1="480" x2="920" y2="480" stroke="#333" stroke-width="1.2"/>
<line x1="90" y1="90" x2="90" y2="480" stroke="#333" stroke-width="1.2"/>
<text x="90.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">1 replica</text>
<text x="505.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">2 replicas</text>
<text x="920.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">4 replicas</text>
<text x="505.0" y="538" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">milliseconds</text>
<text x="24" y="285" text-anchor="middle" transform="rotate(-90 24 285)" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">milliseconds</text>
<path d="M90.0,439.9 L505.0,445.8 L920.0,446.7" fill="none" stroke="#1f77b4" stroke-width="2.5"/>
<circle cx="90.0" cy="439.9" r="4" fill="#1f77b4"/>
<text x="90.0" y="429.9" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">20.6 ms</text>
<circle cx="505.0" cy="445.8" r="4" fill="#1f77b4"/>
<text x="505.0" y="435.8" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">17.5 ms</text>
<circle cx="920.0" cy="446.7" r="4" fill="#1f77b4"/>
<text x="920.0" y="436.7" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">17.1 ms</text>
<line x1="110" y1="514" x2="134" y2="514" stroke="#1f77b4" stroke-width="3"/>
<text x="142" y="518" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">p50 ms</text>
<path d="M90.0,362.2 L505.0,394.7 L920.0,398.9" fill="none" stroke="#d62728" stroke-width="2.5"/>
<circle cx="90.0" cy="362.2" r="4" fill="#d62728"/>
<text x="90.0" y="352.2" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#d62728">60.4 ms</text>
<circle cx="505.0" cy="394.7" r="4" fill="#d62728"/>
<text x="505.0" y="384.7" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#d62728">43.7 ms</text>
<circle cx="920.0" cy="398.9" r="4" fill="#d62728"/>
<text x="920.0" y="388.9" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#d62728">41.6 ms</text>
<line x1="340" y1="514" x2="364" y2="514" stroke="#d62728" stroke-width="3"/>
<text x="372" y="518" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">p95 ms</text>
<path d="M90.0,303.1 L505.0,323.9 L920.0,351.3" fill="none" stroke="#2ca02c" stroke-width="2.5"/>
<circle cx="90.0" cy="303.1" r="4" fill="#2ca02c"/>
<text x="90.0" y="293.1" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#2ca02c">90.7 ms</text>
<circle cx="505.0" cy="323.9" r="4" fill="#2ca02c"/>
<text x="505.0" y="313.9" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#2ca02c">80.1 ms</text>
<circle cx="920.0" cy="351.3" r="4" fill="#2ca02c"/>
<text x="920.0" y="341.3" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#2ca02c">66.0 ms</text>
<line x1="570" y1="514" x2="594" y2="514" stroke="#2ca02c" stroke-width="3"/>
<text x="602" y="518" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">p99 ms</text>
</svg>
+29
View File
@@ -0,0 +1,29 @@
<line x1="90" y1="480.0" x2="920" y2="480.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="484.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">0.0</text>
<line x1="90" y1="402.0" x2="920" y2="402.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="406.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">400.0</text>
<line x1="90" y1="324.0" x2="920" y2="324.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="328.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">800.0</text>
<line x1="90" y1="246.0" x2="920" y2="246.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="250.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">1200.0</text>
<line x1="90" y1="168.0" x2="920" y2="168.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="172.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">1600.0</text>
<line x1="90" y1="90.0" x2="920" y2="90.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="94.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">2000.0</text>
<line x1="90" y1="480" x2="920" y2="480" stroke="#333" stroke-width="1.2"/>
<line x1="90" y1="90" x2="90" y2="480" stroke="#333" stroke-width="1.2"/>
<text x="90.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">1 replica</text>
<text x="505.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">2 replicas</text>
<text x="920.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">4 replicas</text>
<text x="505.0" y="538" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">HTTP 2xx acknowledgements / second</text>
<text x="24" y="285" text-anchor="middle" transform="rotate(-90 24 285)" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">HTTP 2xx acknowledgements / second</text>
<path d="M90.0,240.4 L505.0,179.3 L920.0,170.8" fill="none" stroke="#1f77b4" stroke-width="2.5"/>
<circle cx="90.0" cy="240.4" r="4" fill="#1f77b4"/>
<text x="90.0" y="230.4" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">1228.8</text>
<circle cx="505.0" cy="179.3" r="4" fill="#1f77b4"/>
<text x="505.0" y="169.3" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">1542.0</text>
<circle cx="920.0" cy="170.8" r="4" fill="#1f77b4"/>
<text x="920.0" y="160.8" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">1585.9</text>
<line x1="110" y1="514" x2="134" y2="514" stroke="#1f77b4" stroke-width="3"/>
<text x="142" y="518" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">successful RPS</text>
</svg>
+29
View File
@@ -0,0 +1,29 @@
<line x1="90" y1="480.0" x2="920" y2="480.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="484.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">0.0</text>
<line x1="90" y1="402.0" x2="920" y2="402.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="406.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">400.0</text>
<line x1="90" y1="324.0" x2="920" y2="324.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="328.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">800.0</text>
<line x1="90" y1="246.0" x2="920" y2="246.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="250.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">1200.0</text>
<line x1="90" y1="168.0" x2="920" y2="168.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="172.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">1600.0</text>
<line x1="90" y1="90.0" x2="920" y2="90.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="94.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">2000.0</text>
<line x1="90" y1="480" x2="920" y2="480" stroke="#333" stroke-width="1.2"/>
<line x1="90" y1="90" x2="90" y2="480" stroke="#333" stroke-width="1.2"/>
<text x="90.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">API total 0.4 vCPU</text>
<text x="505.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">API total 0.7 vCPU</text>
<text x="920.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">API total 0.9 vCPU</text>
<text x="505.0" y="538" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">HTTP 2xx acknowledgements / second</text>
<text x="24" y="285" text-anchor="middle" transform="rotate(-90 24 285)" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">HTTP 2xx acknowledgements / second</text>
<path d="M90.0,180.8 L505.0,227.8 L920.0,178.3" fill="none" stroke="#1f77b4" stroke-width="2.5"/>
<circle cx="90.0" cy="180.8" r="4" fill="#1f77b4"/>
<text x="90.0" y="170.8" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">1534.2</text>
<circle cx="505.0" cy="227.8" r="4" fill="#1f77b4"/>
<text x="505.0" y="217.8" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">1293.4</text>
<circle cx="920.0" cy="178.3" r="4" fill="#1f77b4"/>
<text x="920.0" y="168.3" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#1f77b4">1547.4</text>
<line x1="110" y1="514" x2="134" y2="514" stroke="#1f77b4" stroke-width="3"/>
<text x="142" y="518" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">successful RPS</text>
</svg>
@@ -0,0 +1,36 @@
<line x1="90" y1="480.0" x2="920" y2="480.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="484.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">0.0</text>
<line x1="90" y1="402.0" x2="920" y2="402.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="406.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">22.0</text>
<line x1="90" y1="324.0" x2="920" y2="324.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="328.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">44.0</text>
<line x1="90" y1="246.0" x2="920" y2="246.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="250.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">66.0</text>
<line x1="90" y1="168.0" x2="920" y2="168.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="172.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">88.0</text>
<line x1="90" y1="90.0" x2="920" y2="90.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="94.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">110.0</text>
<line x1="90" y1="480" x2="920" y2="480" stroke="#333" stroke-width="1.2"/>
<line x1="90" y1="90" x2="90" y2="480" stroke="#333" stroke-width="1.2"/>
<text x="90.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">API total 0.4 vCPU</text>
<text x="505.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">API total 0.7 vCPU</text>
<text x="920.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">API total 0.9 vCPU</text>
<text x="505.0" y="538" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">percent of container CPU limit</text>
<text x="24" y="285" text-anchor="middle" transform="rotate(-90 24 285)" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">percent of container CPU limit</text>
<rect x="-6.8" y="129.8" width="93.8" height="350.2" fill="#1f77b4" opacity="0.88"/>
<text x="41.6" y="123.8" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">98.8%</text>
<rect x="408.2" y="239.3" width="93.8" height="240.7" fill="#1f77b4" opacity="0.88"/>
<text x="456.6" y="233.3" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">67.9%</text>
<rect x="823.2" y="295.4" width="93.8" height="184.6" fill="#1f77b4" opacity="0.88"/>
<text x="871.6" y="289.4" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">52.1%</text>
<rect x="110" y="505" width="16" height="12" fill="#1f77b4"/>
<text x="134" y="515" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">API</text>
<rect x="90.0" y="175.3" width="93.8" height="304.7" fill="#d62728" opacity="0.88"/>
<text x="138.4" y="169.3" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">85.9%</text>
<rect x="505.0" y="139.7" width="93.8" height="340.3" fill="#d62728" opacity="0.88"/>
<text x="553.4" y="133.7" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">96.0%</text>
<rect x="920.0" y="131.7" width="93.8" height="348.3" fill="#d62728" opacity="0.88"/>
<text x="968.4" y="125.7" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">98.2%</text>
<rect x="340" y="505" width="16" height="12" fill="#d62728"/>
<text x="364" y="515" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">PostgreSQL</text>
</svg>
@@ -0,0 +1,25 @@
<line x1="90" y1="480.0" x2="920" y2="480.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="484.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">0.0</text>
<line x1="90" y1="402.0" x2="920" y2="402.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="406.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">9.4</text>
<line x1="90" y1="324.0" x2="920" y2="324.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="328.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">18.9</text>
<line x1="90" y1="246.0" x2="920" y2="246.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="250.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">28.3</text>
<line x1="90" y1="168.0" x2="920" y2="168.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="172.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">37.8</text>
<line x1="90" y1="90.0" x2="920" y2="90.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="94.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">47.2</text>
<line x1="90" y1="480" x2="920" y2="480" stroke="#333" stroke-width="1.2"/>
<line x1="90" y1="90" x2="90" y2="480" stroke="#333" stroke-width="1.2"/>
<text x="90.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">baseline</text>
<text x="920.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">optimized</text>
<text x="505.0" y="538" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">milliseconds</text>
<text x="24" y="285" text-anchor="middle" transform="rotate(-90 24 285)" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">milliseconds</text>
<rect x="-55.2" y="155.0" width="287.5" height="325.0" fill="#1f77b4" opacity="0.88"/>
<text x="90.0" y="149.0" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">39.4 ms</text>
<rect x="774.8" y="224.7" width="287.5" height="255.3" fill="#1f77b4" opacity="0.88"/>
<text x="920.0" y="218.7" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">30.9 ms</text>
<rect x="110" y="505" width="16" height="12" fill="#1f77b4"/>
<text x="134" y="515" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">p95 ms</text>
</svg>
+25
View File
@@ -0,0 +1,25 @@
<line x1="90" y1="480.0" x2="920" y2="480.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="484.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">0.0</text>
<line x1="90" y1="402.0" x2="920" y2="402.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="406.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">574.8</text>
<line x1="90" y1="324.0" x2="920" y2="324.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="328.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">1149.7</text>
<line x1="90" y1="246.0" x2="920" y2="246.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="250.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">1724.5</text>
<line x1="90" y1="168.0" x2="920" y2="168.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="172.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">2299.3</text>
<line x1="90" y1="90.0" x2="920" y2="90.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="94.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">2874.2</text>
<line x1="90" y1="480" x2="920" y2="480" stroke="#333" stroke-width="1.2"/>
<line x1="90" y1="90" x2="90" y2="480" stroke="#333" stroke-width="1.2"/>
<text x="90.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">baseline</text>
<text x="920.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">optimized</text>
<text x="505.0" y="538" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">HTTP 2xx acknowledgements / second</text>
<text x="24" y="285" text-anchor="middle" transform="rotate(-90 24 285)" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">HTTP 2xx acknowledgements / second</text>
<rect x="-55.2" y="258.8" width="287.5" height="221.2" fill="#1f77b4" opacity="0.88"/>
<text x="90.0" y="252.8" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">1630.1</text>
<rect x="774.8" y="155.0" width="287.5" height="325.0" fill="#1f77b4" opacity="0.88"/>
<text x="920.0" y="149.0" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">2395.1</text>
<rect x="110" y="505" width="16" height="12" fill="#1f77b4"/>
<text x="134" y="515" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">successful RPS</text>
</svg>
+44
View File
@@ -0,0 +1,44 @@
<line x1="90" y1="480.0" x2="920" y2="480.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="484.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">0.0</text>
<line x1="90" y1="402.0" x2="920" y2="402.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="406.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">22.0</text>
<line x1="90" y1="324.0" x2="920" y2="324.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="328.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">44.0</text>
<line x1="90" y1="246.0" x2="920" y2="246.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="250.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">66.0</text>
<line x1="90" y1="168.0" x2="920" y2="168.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="172.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">88.0</text>
<line x1="90" y1="90.0" x2="920" y2="90.0" stroke="#e5e5e5" stroke-width="1"/>
<text x="82" y="94.0" text-anchor="end" font-family="Helvetica,Arial,sans-serif" font-size="11" fill="#555">110.0</text>
<line x1="90" y1="480" x2="920" y2="480" stroke="#333" stroke-width="1.2"/>
<line x1="90" y1="90" x2="90" y2="480" stroke="#333" stroke-width="1.2"/>
<text x="90.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">1 replica</text>
<text x="505.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">2 replicas</text>
<text x="920.0" y="504" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">4 replicas</text>
<text x="505.0" y="538" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">percent of container CPU limit</text>
<text x="24" y="285" text-anchor="middle" transform="rotate(-90 24 285)" font-family="Helvetica,Arial,sans-serif" font-size="13" fill="#333">percent of container CPU limit</text>
<rect x="-6.8" y="324.3" width="61.6" height="155.7" fill="#1f77b4" opacity="0.88"/>
<text x="25.4" y="318.3" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">43.9%</text>
<rect x="408.2" y="297.0" width="61.6" height="183.0" fill="#1f77b4" opacity="0.88"/>
<text x="440.4" y="291.0" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">51.6%</text>
<rect x="823.2" y="270.6" width="61.6" height="209.4" fill="#1f77b4" opacity="0.88"/>
<text x="855.4" y="264.6" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">59.1%</text>
<rect x="110" y="505" width="16" height="12" fill="#1f77b4"/>
<text x="134" y="515" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">API</text>
<rect x="57.7" y="139.7" width="61.6" height="340.3" fill="#d62728" opacity="0.88"/>
<text x="90.0" y="133.7" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">96.0%</text>
<rect x="472.7" y="133.2" width="61.6" height="346.8" fill="#d62728" opacity="0.88"/>
<text x="505.0" y="127.2" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">97.8%</text>
<rect x="887.7" y="132.0" width="61.6" height="348.0" fill="#d62728" opacity="0.88"/>
<text x="920.0" y="126.0" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">98.2%</text>
<rect x="340" y="505" width="16" height="12" fill="#d62728"/>
<text x="364" y="515" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">PostgreSQL</text>
<rect x="122.3" y="314.8" width="61.6" height="165.2" fill="#2ca02c" opacity="0.88"/>
<text x="154.6" y="308.8" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">46.6%</text>
<rect x="537.3" y="316.4" width="61.6" height="163.6" fill="#2ca02c" opacity="0.88"/>
<text x="569.6" y="310.4" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">46.1%</text>
<rect x="952.3" y="322.1" width="61.6" height="157.9" fill="#2ca02c" opacity="0.88"/>
<text x="984.6" y="316.1" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="10" fill="#222">44.5%</text>
<rect x="570" y="505" width="16" height="12" fill="#2ca02c"/>
<text x="594" y="515" font-family="Helvetica,Arial,sans-serif" font-size="12" fill="#333">HAProxy</text>
</svg>
+209
View File
@@ -0,0 +1,209 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:04:31.140808Z",
"finished_at": "2026-12-02T16:04:51.152725Z",
"measured_seconds": 20.013,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 19906,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 994.678,
"offered_rps": 994.678,
"successful_latency_ms": {
"p50": 27.347,
"p95": 66.804,
"p99": 90.713,
"max": 150.072,
"mean": 32.133
},
"status_counts": {
"201": 19906
},
"instances": {
"e664e35d3dfc": 19906
},
"app_versions": {
"1.0.0": 19906
},
"kinds": {
"write": 19906
},
"series": [
{
"second": 1796227471,
"success": 644,
"errors": 0,
"p50_ms": 39.74,
"p95_ms": 70.041,
"p99_ms": 85.453
},
{
"second": 1796227472,
"success": 708,
"errors": 0,
"p50_ms": 39.44,
"p95_ms": 80.746,
"p99_ms": 106.671
},
{
"second": 1796227473,
"success": 888,
"errors": 0,
"p50_ms": 29.914,
"p95_ms": 66.748,
"p99_ms": 105.574
},
{
"second": 1796227474,
"success": 1398,
"errors": 0,
"p50_ms": 21.656,
"p95_ms": 32.757,
"p99_ms": 39.039
},
{
"second": 1796227475,
"success": 1332,
"errors": 0,
"p50_ms": 22.286,
"p95_ms": 38.292,
"p99_ms": 44.014
},
{
"second": 1796227476,
"success": 917,
"errors": 0,
"p50_ms": 30.45,
"p95_ms": 78.028,
"p99_ms": 98.937
},
{
"second": 1796227477,
"success": 639,
"errors": 0,
"p50_ms": 48.949,
"p95_ms": 83.808,
"p99_ms": 92.358
},
{
"second": 1796227478,
"success": 786,
"errors": 0,
"p50_ms": 38.086,
"p95_ms": 68.964,
"p99_ms": 76.975
},
{
"second": 1796227479,
"success": 683,
"errors": 0,
"p50_ms": 43.431,
"p95_ms": 78.639,
"p99_ms": 88.981
},
{
"second": 1796227480,
"success": 1113,
"errors": 0,
"p50_ms": 26.558,
"p95_ms": 46.438,
"p99_ms": 57.072
},
{
"second": 1796227481,
"success": 1437,
"errors": 0,
"p50_ms": 20.947,
"p95_ms": 35.513,
"p99_ms": 41.665
},
{
"second": 1796227482,
"success": 1375,
"errors": 0,
"p50_ms": 20.267,
"p95_ms": 36.141,
"p99_ms": 76.791
},
{
"second": 1796227483,
"success": 1054,
"errors": 0,
"p50_ms": 25.065,
"p95_ms": 59.632,
"p99_ms": 95.104
},
{
"second": 1796227484,
"success": 727,
"errors": 0,
"p50_ms": 38.328,
"p95_ms": 86.884,
"p99_ms": 100.799
},
{
"second": 1796227485,
"success": 1041,
"errors": 0,
"p50_ms": 29.618,
"p95_ms": 48.9,
"p99_ms": 63.329
},
{
"second": 1796227486,
"success": 1265,
"errors": 0,
"p50_ms": 21.773,
"p95_ms": 50.682,
"p99_ms": 75.402
},
{
"second": 1796227487,
"success": 984,
"errors": 0,
"p50_ms": 30.116,
"p95_ms": 55.382,
"p99_ms": 94.019
},
{
"second": 1796227488,
"success": 898,
"errors": 0,
"p50_ms": 30.254,
"p95_ms": 77.951,
"p99_ms": 120.287
},
{
"second": 1796227489,
"success": 730,
"errors": 0,
"p50_ms": 38.187,
"p95_ms": 84.345,
"p99_ms": 96.423
},
{
"second": 1796227490,
"success": 1046,
"errors": 0,
"p50_ms": 29.161,
"p95_ms": 55.766,
"p99_ms": 67.977
},
{
"second": 1796227491,
"success": 241,
"errors": 0,
"p50_ms": 17.684,
"p95_ms": 26.692,
"p99_ms": 28.034
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r1-rep1; replicas=1 cpu_per=0.8 mem_per=512M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+209
View File
@@ -0,0 +1,209 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:06:39.46736Z",
"finished_at": "2026-12-02T16:06:59.48031Z",
"measured_seconds": 20.014,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 24592,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1228.768,
"offered_rps": 1228.768,
"successful_latency_ms": {
"p50": 20.578,
"p95": 60.385,
"p99": 93.253,
"max": 234.757,
"mean": 26.023
},
"status_counts": {
"201": 24592
},
"instances": {
"4fd73a92c31b": 24592
},
"app_versions": {
"1.0.0": 24592
},
"kinds": {
"write": 24592
},
"series": [
{
"second": 1796227599,
"success": 509,
"errors": 0,
"p50_ms": 29.58,
"p95_ms": 61.205,
"p99_ms": 72.578
},
{
"second": 1796227600,
"success": 1271,
"errors": 0,
"p50_ms": 22.275,
"p95_ms": 52.895,
"p99_ms": 116.564
},
{
"second": 1796227601,
"success": 980,
"errors": 0,
"p50_ms": 25.795,
"p95_ms": 67.931,
"p99_ms": 111.531
},
{
"second": 1796227602,
"success": 1016,
"errors": 0,
"p50_ms": 27.83,
"p95_ms": 50.903,
"p99_ms": 61.94
},
{
"second": 1796227603,
"success": 1468,
"errors": 0,
"p50_ms": 20.196,
"p95_ms": 34.926,
"p99_ms": 40.75
},
{
"second": 1796227604,
"success": 1844,
"errors": 0,
"p50_ms": 14.787,
"p95_ms": 29.483,
"p99_ms": 53.045
},
{
"second": 1796227605,
"success": 1834,
"errors": 0,
"p50_ms": 16.124,
"p95_ms": 26.198,
"p99_ms": 32.693
},
{
"second": 1796227606,
"success": 1008,
"errors": 0,
"p50_ms": 28.017,
"p95_ms": 57.153,
"p99_ms": 63.219
},
{
"second": 1796227607,
"success": 446,
"errors": 0,
"p50_ms": 68.731,
"p95_ms": 171.612,
"p99_ms": 204.224
},
{
"second": 1796227608,
"success": 633,
"errors": 0,
"p50_ms": 44.553,
"p95_ms": 92.62,
"p99_ms": 110.218
},
{
"second": 1796227609,
"success": 633,
"errors": 0,
"p50_ms": 45.125,
"p95_ms": 94.131,
"p99_ms": 127.403
},
{
"second": 1796227610,
"success": 701,
"errors": 0,
"p50_ms": 40.384,
"p95_ms": 85.835,
"p99_ms": 107.047
},
{
"second": 1796227611,
"success": 1060,
"errors": 0,
"p50_ms": 25.823,
"p95_ms": 58.126,
"p99_ms": 78.879
},
{
"second": 1796227612,
"success": 1651,
"errors": 0,
"p50_ms": 17.391,
"p95_ms": 33.234,
"p99_ms": 39.462
},
{
"second": 1796227613,
"success": 1791,
"errors": 0,
"p50_ms": 15.968,
"p95_ms": 31.564,
"p99_ms": 38.372
},
{
"second": 1796227614,
"success": 1683,
"errors": 0,
"p50_ms": 16.272,
"p95_ms": 32.785,
"p99_ms": 62.781
},
{
"second": 1796227615,
"success": 1459,
"errors": 0,
"p50_ms": 18.66,
"p95_ms": 39.079,
"p99_ms": 46.601
},
{
"second": 1796227616,
"success": 1068,
"errors": 0,
"p50_ms": 22.501,
"p95_ms": 81.968,
"p99_ms": 105.02
},
{
"second": 1796227617,
"success": 987,
"errors": 0,
"p50_ms": 25.887,
"p95_ms": 74.2,
"p99_ms": 89.284
},
{
"second": 1796227618,
"success": 1719,
"errors": 0,
"p50_ms": 16.593,
"p95_ms": 32.311,
"p99_ms": 35.924
},
{
"second": 1796227619,
"success": 831,
"errors": 0,
"p50_ms": 16.994,
"p95_ms": 25.998,
"p99_ms": 30.146
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r1-rep2; replicas=1 cpu_per=0.8 mem_per=512M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+209
View File
@@ -0,0 +1,209 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:08:42.886861Z",
"finished_at": "2026-12-02T16:09:02.898468Z",
"measured_seconds": 20.012,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 32051,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1601.574,
"offered_rps": 1601.574,
"successful_latency_ms": {
"p50": 17.151,
"p95": 36.89,
"p99": 53.276,
"max": 280.783,
"mean": 19.967
},
"status_counts": {
"201": 32051
},
"instances": {
"a7312917856c": 32051
},
"app_versions": {
"1.0.0": 32051
},
"kinds": {
"write": 32051
},
"series": [
{
"second": 1796227722,
"success": 233,
"errors": 0,
"p50_ms": 14.878,
"p95_ms": 21.517,
"p99_ms": 22.919
},
{
"second": 1796227723,
"success": 2024,
"errors": 0,
"p50_ms": 14.651,
"p95_ms": 25.41,
"p99_ms": 32.222
},
{
"second": 1796227724,
"success": 1934,
"errors": 0,
"p50_ms": 14.957,
"p95_ms": 27.022,
"p99_ms": 32.781
},
{
"second": 1796227725,
"success": 1722,
"errors": 0,
"p50_ms": 16.231,
"p95_ms": 32.248,
"p99_ms": 64.707
},
{
"second": 1796227726,
"success": 1532,
"errors": 0,
"p50_ms": 18.115,
"p95_ms": 39.047,
"p99_ms": 52.012
},
{
"second": 1796227727,
"success": 1180,
"errors": 0,
"p50_ms": 22.5,
"p95_ms": 53.102,
"p99_ms": 63.066
},
{
"second": 1796227728,
"success": 1184,
"errors": 0,
"p50_ms": 24.529,
"p95_ms": 45.069,
"p99_ms": 67.176
},
{
"second": 1796227729,
"success": 1907,
"errors": 0,
"p50_ms": 15.428,
"p95_ms": 25.815,
"p99_ms": 37.143
},
{
"second": 1796227730,
"success": 1664,
"errors": 0,
"p50_ms": 17.751,
"p95_ms": 28.966,
"p99_ms": 39.172
},
{
"second": 1796227731,
"success": 1770,
"errors": 0,
"p50_ms": 15.665,
"p95_ms": 33.254,
"p99_ms": 43.324
},
{
"second": 1796227732,
"success": 981,
"errors": 0,
"p50_ms": 21.886,
"p95_ms": 67.843,
"p99_ms": 268.124
},
{
"second": 1796227733,
"success": 1486,
"errors": 0,
"p50_ms": 18.769,
"p95_ms": 33.958,
"p99_ms": 40.272
},
{
"second": 1796227734,
"success": 1819,
"errors": 0,
"p50_ms": 15.764,
"p95_ms": 26.819,
"p99_ms": 64.073
},
{
"second": 1796227735,
"success": 1987,
"errors": 0,
"p50_ms": 14.515,
"p95_ms": 27.857,
"p99_ms": 35.923
},
{
"second": 1796227736,
"success": 1573,
"errors": 0,
"p50_ms": 18.036,
"p95_ms": 39.423,
"p99_ms": 47.605
},
{
"second": 1796227737,
"success": 1715,
"errors": 0,
"p50_ms": 16.099,
"p95_ms": 32.1,
"p99_ms": 49.935
},
{
"second": 1796227738,
"success": 1879,
"errors": 0,
"p50_ms": 14.95,
"p95_ms": 29.567,
"p99_ms": 40.504
},
{
"second": 1796227739,
"success": 1811,
"errors": 0,
"p50_ms": 15.163,
"p95_ms": 29.425,
"p99_ms": 33.544
},
{
"second": 1796227740,
"success": 1357,
"errors": 0,
"p50_ms": 21.131,
"p95_ms": 45.925,
"p99_ms": 51.083
},
{
"second": 1796227741,
"success": 1027,
"errors": 0,
"p50_ms": 27.319,
"p95_ms": 49.963,
"p99_ms": 59.76
},
{
"second": 1796227742,
"success": 1266,
"errors": 0,
"p50_ms": 21.13,
"p95_ms": 35.08,
"p99_ms": 43.646
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r1-rep3; replicas=1 cpu_per=0.8 mem_per=512M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+210
View File
@@ -0,0 +1,210 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:05:12.509659Z",
"finished_at": "2026-12-02T16:05:32.520623Z",
"measured_seconds": 20.012,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 20985,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1048.644,
"offered_rps": 1048.644,
"successful_latency_ms": {
"p50": 24.933,
"p95": 69.935,
"p99": 98.498,
"max": 213.917,
"mean": 30.486
},
"status_counts": {
"201": 20985
},
"instances": {
"dae80dd7ac8c": 10492,
"e719b7e958c3": 10493
},
"app_versions": {
"1.0.0": 20985
},
"kinds": {
"write": 20985
},
"series": [
{
"second": 1796227512,
"success": 735,
"errors": 0,
"p50_ms": 20.203,
"p95_ms": 39.223,
"p99_ms": 42.921
},
{
"second": 1796227513,
"success": 1427,
"errors": 0,
"p50_ms": 20.221,
"p95_ms": 43.492,
"p99_ms": 48.935
},
{
"second": 1796227514,
"success": 1044,
"errors": 0,
"p50_ms": 25.506,
"p95_ms": 66.915,
"p99_ms": 77.817
},
{
"second": 1796227515,
"success": 842,
"errors": 0,
"p50_ms": 32.722,
"p95_ms": 80.144,
"p99_ms": 102.854
},
{
"second": 1796227516,
"success": 849,
"errors": 0,
"p50_ms": 34.819,
"p95_ms": 77.719,
"p99_ms": 102.807
},
{
"second": 1796227517,
"success": 752,
"errors": 0,
"p50_ms": 40.769,
"p95_ms": 88.878,
"p99_ms": 105.213
},
{
"second": 1796227518,
"success": 982,
"errors": 0,
"p50_ms": 27.858,
"p95_ms": 64.506,
"p99_ms": 72.106
},
{
"second": 1796227519,
"success": 1363,
"errors": 0,
"p50_ms": 20.867,
"p95_ms": 46.123,
"p99_ms": 58.628
},
{
"second": 1796227520,
"success": 1380,
"errors": 0,
"p50_ms": 21.103,
"p95_ms": 43.262,
"p99_ms": 58.045
},
{
"second": 1796227521,
"success": 1262,
"errors": 0,
"p50_ms": 22.073,
"p95_ms": 54.023,
"p99_ms": 69.172
},
{
"second": 1796227522,
"success": 746,
"errors": 0,
"p50_ms": 37.265,
"p95_ms": 90.287,
"p99_ms": 119.863
},
{
"second": 1796227523,
"success": 911,
"errors": 0,
"p50_ms": 27.341,
"p95_ms": 80.725,
"p99_ms": 102.419
},
{
"second": 1796227524,
"success": 1470,
"errors": 0,
"p50_ms": 19.498,
"p95_ms": 39.485,
"p99_ms": 60.66
},
{
"second": 1796227525,
"success": 1462,
"errors": 0,
"p50_ms": 21.562,
"p95_ms": 38.24,
"p99_ms": 46.518
},
{
"second": 1796227526,
"success": 1141,
"errors": 0,
"p50_ms": 23.632,
"p95_ms": 62.384,
"p99_ms": 77.234
},
{
"second": 1796227527,
"success": 1005,
"errors": 0,
"p50_ms": 25.639,
"p95_ms": 73.449,
"p99_ms": 102.351
},
{
"second": 1796227528,
"success": 565,
"errors": 0,
"p50_ms": 49.735,
"p95_ms": 123.839,
"p99_ms": 178.826
},
{
"second": 1796227529,
"success": 682,
"errors": 0,
"p50_ms": 41.061,
"p95_ms": 105.622,
"p99_ms": 178.506
},
{
"second": 1796227530,
"success": 655,
"errors": 0,
"p50_ms": 40.955,
"p95_ms": 88.458,
"p99_ms": 139.661
},
{
"second": 1796227531,
"success": 1095,
"errors": 0,
"p50_ms": 27.115,
"p95_ms": 50.724,
"p99_ms": 63.494
},
{
"second": 1796227532,
"success": 617,
"errors": 0,
"p50_ms": 22.457,
"p95_ms": 58.24,
"p99_ms": 67.626
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r2-rep1; replicas=2 cpu_per=0.4 mem_per=256M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+210
View File
@@ -0,0 +1,210 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:07:19.911024Z",
"finished_at": "2026-12-02T16:07:39.934637Z",
"measured_seconds": 20.024,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 30877,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1541.984,
"offered_rps": 1541.984,
"successful_latency_ms": {
"p50": 17.523,
"p95": 43.548,
"p99": 64.976,
"max": 166.901,
"mean": 20.717
},
"status_counts": {
"201": 30877
},
"instances": {
"79bc66f42a40": 15439,
"9e69435e37f5": 15438
},
"app_versions": {
"1.0.0": 30877
},
"kinds": {
"write": 30877
},
"series": [
{
"second": 1796227639,
"success": 173,
"errors": 0,
"p50_ms": 15.968,
"p95_ms": 30.787,
"p99_ms": 45.035
},
{
"second": 1796227640,
"success": 1297,
"errors": 0,
"p50_ms": 20.108,
"p95_ms": 53.731,
"p99_ms": 79.809
},
{
"second": 1796227641,
"success": 1102,
"errors": 0,
"p50_ms": 26.785,
"p95_ms": 63.379,
"p99_ms": 75.988
},
{
"second": 1796227642,
"success": 1173,
"errors": 0,
"p50_ms": 21.764,
"p95_ms": 45.306,
"p99_ms": 152.176
},
{
"second": 1796227643,
"success": 1955,
"errors": 0,
"p50_ms": 15.231,
"p95_ms": 34.967,
"p99_ms": 40.431
},
{
"second": 1796227644,
"success": 1892,
"errors": 0,
"p50_ms": 14.913,
"p95_ms": 33.105,
"p99_ms": 43.789
},
{
"second": 1796227645,
"success": 1573,
"errors": 0,
"p50_ms": 17.925,
"p95_ms": 45.733,
"p99_ms": 61.117
},
{
"second": 1796227646,
"success": 1279,
"errors": 0,
"p50_ms": 20.628,
"p95_ms": 54.416,
"p99_ms": 71.913
},
{
"second": 1796227647,
"success": 1436,
"errors": 0,
"p50_ms": 18.861,
"p95_ms": 46.286,
"p99_ms": 69.615
},
{
"second": 1796227648,
"success": 1791,
"errors": 0,
"p50_ms": 15.587,
"p95_ms": 34.073,
"p99_ms": 43.379
},
{
"second": 1796227649,
"success": 1828,
"errors": 0,
"p50_ms": 16.661,
"p95_ms": 30.402,
"p99_ms": 40.772
},
{
"second": 1796227650,
"success": 1467,
"errors": 0,
"p50_ms": 18.433,
"p95_ms": 46.425,
"p99_ms": 63.497
},
{
"second": 1796227651,
"success": 980,
"errors": 0,
"p50_ms": 32.124,
"p95_ms": 62.904,
"p99_ms": 78.968
},
{
"second": 1796227652,
"success": 1544,
"errors": 0,
"p50_ms": 17.866,
"p95_ms": 38.168,
"p99_ms": 49.094
},
{
"second": 1796227653,
"success": 1921,
"errors": 0,
"p50_ms": 15.223,
"p95_ms": 29.434,
"p99_ms": 33.197
},
{
"second": 1796227654,
"success": 1918,
"errors": 0,
"p50_ms": 15.329,
"p95_ms": 30.067,
"p99_ms": 41.168
},
{
"second": 1796227655,
"success": 1344,
"errors": 0,
"p50_ms": 21.752,
"p95_ms": 45.777,
"p99_ms": 59.858
},
{
"second": 1796227656,
"success": 1159,
"errors": 0,
"p50_ms": 25.723,
"p95_ms": 55.346,
"p99_ms": 65.418
},
{
"second": 1796227657,
"success": 1376,
"errors": 0,
"p50_ms": 19.277,
"p95_ms": 59.756,
"p99_ms": 77.249
},
{
"second": 1796227658,
"success": 1903,
"errors": 0,
"p50_ms": 15.214,
"p95_ms": 29.161,
"p99_ms": 35.781
},
{
"second": 1796227659,
"success": 1766,
"errors": 0,
"p50_ms": 15.224,
"p95_ms": 32.357,
"p99_ms": 37.51
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r2-rep2; replicas=2 cpu_per=0.4 mem_per=256M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+210
View File
@@ -0,0 +1,210 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:09:22.539183Z",
"finished_at": "2026-12-02T16:09:42.559306Z",
"measured_seconds": 20.021,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 32067,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1601.691,
"offered_rps": 1601.691,
"successful_latency_ms": {
"p50": 16.255,
"p95": 43.743,
"p99": 80.069,
"max": 213.02,
"mean": 19.961
},
"status_counts": {
"201": 32067
},
"instances": {
"4cfc97bbc3a2": 16033,
"dc8c2fcaf94f": 16034
},
"app_versions": {
"1.0.0": 32067
},
"kinds": {
"write": 32067
},
"series": [
{
"second": 1796227762,
"success": 886,
"errors": 0,
"p50_ms": 15.845,
"p95_ms": 30.062,
"p99_ms": 35.665
},
{
"second": 1796227763,
"success": 1890,
"errors": 0,
"p50_ms": 15.556,
"p95_ms": 31.195,
"p99_ms": 40.989
},
{
"second": 1796227764,
"success": 1871,
"errors": 0,
"p50_ms": 15.561,
"p95_ms": 33.707,
"p99_ms": 41.001
},
{
"second": 1796227765,
"success": 1807,
"errors": 0,
"p50_ms": 16.292,
"p95_ms": 34.012,
"p99_ms": 40.576
},
{
"second": 1796227766,
"success": 1784,
"errors": 0,
"p50_ms": 16.311,
"p95_ms": 34.433,
"p99_ms": 40.943
},
{
"second": 1796227767,
"success": 714,
"errors": 0,
"p50_ms": 39.941,
"p95_ms": 100.786,
"p99_ms": 121.495
},
{
"second": 1796227768,
"success": 648,
"errors": 0,
"p50_ms": 44.844,
"p95_ms": 94.354,
"p99_ms": 107.511
},
{
"second": 1796227769,
"success": 1563,
"errors": 0,
"p50_ms": 16.927,
"p95_ms": 40.294,
"p99_ms": 54.942
},
{
"second": 1796227770,
"success": 1960,
"errors": 0,
"p50_ms": 14.601,
"p95_ms": 31.493,
"p99_ms": 36.87
},
{
"second": 1796227771,
"success": 1909,
"errors": 0,
"p50_ms": 14.588,
"p95_ms": 33.457,
"p99_ms": 41.768
},
{
"second": 1796227772,
"success": 821,
"errors": 0,
"p50_ms": 26.392,
"p95_ms": 110.652,
"p99_ms": 180.152
},
{
"second": 1796227773,
"success": 873,
"errors": 0,
"p50_ms": 32.554,
"p95_ms": 74.147,
"p99_ms": 91.57
},
{
"second": 1796227774,
"success": 1388,
"errors": 0,
"p50_ms": 18.14,
"p95_ms": 50.056,
"p99_ms": 63.15
},
{
"second": 1796227775,
"success": 1765,
"errors": 0,
"p50_ms": 16.987,
"p95_ms": 36.275,
"p99_ms": 43.323
},
{
"second": 1796227776,
"success": 1853,
"errors": 0,
"p50_ms": 15.374,
"p95_ms": 31.766,
"p99_ms": 40.777
},
{
"second": 1796227777,
"success": 1335,
"errors": 0,
"p50_ms": 18.25,
"p95_ms": 69.028,
"p99_ms": 85.024
},
{
"second": 1796227778,
"success": 2066,
"errors": 0,
"p50_ms": 13.812,
"p95_ms": 31.815,
"p99_ms": 37.328
},
{
"second": 1796227779,
"success": 2058,
"errors": 0,
"p50_ms": 13.672,
"p95_ms": 31.11,
"p99_ms": 41.147
},
{
"second": 1796227780,
"success": 1837,
"errors": 0,
"p50_ms": 15.332,
"p95_ms": 36.557,
"p99_ms": 62.105
},
{
"second": 1796227781,
"success": 2009,
"errors": 0,
"p50_ms": 15.106,
"p95_ms": 28.531,
"p99_ms": 35.752
},
{
"second": 1796227782,
"success": 1030,
"errors": 0,
"p50_ms": 16.43,
"p95_ms": 34.782,
"p99_ms": 45.016
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r2-rep3; replicas=2 cpu_per=0.4 mem_per=256M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:05:57.170757Z",
"finished_at": "2026-12-02T16:06:17.224414Z",
"measured_seconds": 20.054,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 23551,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1174.365,
"offered_rps": 1174.365,
"successful_latency_ms": {
"p50": 22.198,
"p95": 60.984,
"p99": 94.242,
"max": 281.908,
"mean": 27.168
},
"status_counts": {
"201": 23551
},
"instances": {
"31fea2c6693c": 5888,
"3955b84da546": 5888,
"3e20ba1ad7d0": 5888,
"ba15283e3875": 5887
},
"app_versions": {
"1.0.0": 23551
},
"kinds": {
"write": 23551
},
"series": [
{
"second": 1796227557,
"success": 1040,
"errors": 0,
"p50_ms": 21.224,
"p95_ms": 56.972,
"p99_ms": 67.71
},
{
"second": 1796227558,
"success": 1515,
"errors": 0,
"p50_ms": 18.804,
"p95_ms": 41.836,
"p99_ms": 52.069
},
{
"second": 1796227559,
"success": 1376,
"errors": 0,
"p50_ms": 20.44,
"p95_ms": 46.299,
"p99_ms": 62.964
},
{
"second": 1796227560,
"success": 1039,
"errors": 0,
"p50_ms": 27.767,
"p95_ms": 61.223,
"p99_ms": 75.827
},
{
"second": 1796227561,
"success": 837,
"errors": 0,
"p50_ms": 34.275,
"p95_ms": 74.143,
"p99_ms": 104.661
},
{
"second": 1796227562,
"success": 978,
"errors": 0,
"p50_ms": 25.648,
"p95_ms": 79.906,
"p99_ms": 113.055
},
{
"second": 1796227563,
"success": 1586,
"errors": 0,
"p50_ms": 17.656,
"p95_ms": 39.302,
"p99_ms": 48.737
},
{
"second": 1796227564,
"success": 1398,
"errors": 0,
"p50_ms": 20.635,
"p95_ms": 42.159,
"p99_ms": 61.725
},
{
"second": 1796227565,
"success": 1018,
"errors": 0,
"p50_ms": 23.419,
"p95_ms": 81.019,
"p99_ms": 111.869
},
{
"second": 1796227566,
"success": 680,
"errors": 0,
"p50_ms": 35.65,
"p95_ms": 116.455,
"p99_ms": 224.455
},
{
"second": 1796227567,
"success": 809,
"errors": 0,
"p50_ms": 32.257,
"p95_ms": 93.349,
"p99_ms": 135.378
},
{
"second": 1796227568,
"success": 1349,
"errors": 0,
"p50_ms": 21.777,
"p95_ms": 42.293,
"p99_ms": 54.589
},
{
"second": 1796227569,
"success": 1450,
"errors": 0,
"p50_ms": 20.122,
"p95_ms": 41.492,
"p99_ms": 58.795
},
{
"second": 1796227570,
"success": 1326,
"errors": 0,
"p50_ms": 21.377,
"p95_ms": 46.983,
"p99_ms": 53.579
},
{
"second": 1796227571,
"success": 799,
"errors": 0,
"p50_ms": 36.765,
"p95_ms": 90.675,
"p99_ms": 131.607
},
{
"second": 1796227572,
"success": 1131,
"errors": 0,
"p50_ms": 24.373,
"p95_ms": 57.504,
"p99_ms": 79.002
},
{
"second": 1796227573,
"success": 1676,
"errors": 0,
"p50_ms": 17.074,
"p95_ms": 35.481,
"p99_ms": 43.642
},
{
"second": 1796227574,
"success": 1460,
"errors": 0,
"p50_ms": 20.322,
"p95_ms": 41.505,
"p99_ms": 47.685
},
{
"second": 1796227575,
"success": 1105,
"errors": 0,
"p50_ms": 24.134,
"p95_ms": 63.916,
"p99_ms": 79.128
},
{
"second": 1796227576,
"success": 844,
"errors": 0,
"p50_ms": 30.852,
"p95_ms": 87.662,
"p99_ms": 132.28
},
{
"second": 1796227577,
"success": 135,
"errors": 0,
"p50_ms": 34.689,
"p95_ms": 62.151,
"p99_ms": 65.718
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r4-rep1; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:08:01.635514Z",
"finished_at": "2026-12-02T16:08:21.649471Z",
"measured_seconds": 20.015,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 31741,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1585.897,
"offered_rps": 1585.897,
"successful_latency_ms": {
"p50": 17.089,
"p95": 41.487,
"p99": 65.984,
"max": 266.015,
"mean": 20.119
},
"status_counts": {
"201": 31741
},
"instances": {
"084e6f31adc0": 7935,
"1b0e4e22ec35": 7935,
"55cd93c0f756": 7936,
"779be62f0254": 7935
},
"app_versions": {
"1.0.0": 31741
},
"kinds": {
"write": 31741
},
"series": [
{
"second": 1796227681,
"success": 360,
"errors": 0,
"p50_ms": 28.264,
"p95_ms": 86.691,
"p99_ms": 137.846
},
{
"second": 1796227682,
"success": 1091,
"errors": 0,
"p50_ms": 20.888,
"p95_ms": 63.816,
"p99_ms": 109.004
},
{
"second": 1796227683,
"success": 1392,
"errors": 0,
"p50_ms": 21.004,
"p95_ms": 45.011,
"p99_ms": 58.599
},
{
"second": 1796227684,
"success": 1342,
"errors": 0,
"p50_ms": 21.513,
"p95_ms": 44.761,
"p99_ms": 64.214
},
{
"second": 1796227685,
"success": 1548,
"errors": 0,
"p50_ms": 17.427,
"p95_ms": 47.497,
"p99_ms": 68.402
},
{
"second": 1796227686,
"success": 1780,
"errors": 0,
"p50_ms": 16.501,
"p95_ms": 33.054,
"p99_ms": 42.292
},
{
"second": 1796227687,
"success": 1886,
"errors": 0,
"p50_ms": 15.21,
"p95_ms": 33.118,
"p99_ms": 41.967
},
{
"second": 1796227688,
"success": 1885,
"errors": 0,
"p50_ms": 15.335,
"p95_ms": 32.458,
"p99_ms": 45.117
},
{
"second": 1796227689,
"success": 1839,
"errors": 0,
"p50_ms": 15.349,
"p95_ms": 34.966,
"p99_ms": 46.197
},
{
"second": 1796227690,
"success": 1698,
"errors": 0,
"p50_ms": 16.474,
"p95_ms": 38.225,
"p99_ms": 56.153
},
{
"second": 1796227691,
"success": 961,
"errors": 0,
"p50_ms": 24.119,
"p95_ms": 92.863,
"p99_ms": 138.713
},
{
"second": 1796227692,
"success": 1175,
"errors": 0,
"p50_ms": 22.44,
"p95_ms": 55.521,
"p99_ms": 83.401
},
{
"second": 1796227693,
"success": 1764,
"errors": 0,
"p50_ms": 16.075,
"p95_ms": 33.877,
"p99_ms": 51.031
},
{
"second": 1796227694,
"success": 1632,
"errors": 0,
"p50_ms": 17.318,
"p95_ms": 38.216,
"p99_ms": 52.71
},
{
"second": 1796227695,
"success": 1928,
"errors": 0,
"p50_ms": 15.295,
"p95_ms": 30.123,
"p99_ms": 40.239
},
{
"second": 1796227696,
"success": 1442,
"errors": 0,
"p50_ms": 18.262,
"p95_ms": 49.587,
"p99_ms": 68.069
},
{
"second": 1796227697,
"success": 1636,
"errors": 0,
"p50_ms": 17.282,
"p95_ms": 36.741,
"p99_ms": 44.821
},
{
"second": 1796227698,
"success": 1966,
"errors": 0,
"p50_ms": 14.703,
"p95_ms": 31.359,
"p99_ms": 37.554
},
{
"second": 1796227699,
"success": 1731,
"errors": 0,
"p50_ms": 17.073,
"p95_ms": 35.501,
"p99_ms": 42.834
},
{
"second": 1796227700,
"success": 1815,
"errors": 0,
"p50_ms": 15.937,
"p95_ms": 32.942,
"p99_ms": 42.042
},
{
"second": 1796227701,
"success": 870,
"errors": 0,
"p50_ms": 18.884,
"p95_ms": 54.69,
"p99_ms": 76.468
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r4-rep2; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:10:03.998046Z",
"finished_at": "2026-12-02T16:10:24.009835Z",
"measured_seconds": 20.012,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 32482,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1623.096,
"offered_rps": 1623.096,
"successful_latency_ms": {
"p50": 16.552,
"p95": 41.581,
"p99": 62.266,
"max": 146.762,
"mean": 19.695
},
"status_counts": {
"201": 32482
},
"instances": {
"02e13305a5ff": 8121,
"9a3618679a21": 8121,
"b6e324b10968": 8120,
"c6c94e58a823": 8120
},
"app_versions": {
"1.0.0": 32482
},
"kinds": {
"write": 32482
},
"series": [
{
"second": 1796227803,
"success": 2,
"errors": 0,
"p50_ms": 28.192,
"p95_ms": 28.662,
"p99_ms": 28.662
},
{
"second": 1796227804,
"success": 1842,
"errors": 0,
"p50_ms": 15.327,
"p95_ms": 32.617,
"p99_ms": 44.111
},
{
"second": 1796227805,
"success": 1896,
"errors": 0,
"p50_ms": 14.831,
"p95_ms": 35.381,
"p99_ms": 65.374
},
{
"second": 1796227806,
"success": 1333,
"errors": 0,
"p50_ms": 21.612,
"p95_ms": 47.29,
"p99_ms": 65.574
},
{
"second": 1796227807,
"success": 1019,
"errors": 0,
"p50_ms": 27.595,
"p95_ms": 70.192,
"p99_ms": 91.529
},
{
"second": 1796227808,
"success": 1577,
"errors": 0,
"p50_ms": 16.709,
"p95_ms": 45.427,
"p99_ms": 54.061
},
{
"second": 1796227809,
"success": 1940,
"errors": 0,
"p50_ms": 14.807,
"p95_ms": 32.393,
"p99_ms": 38.966
},
{
"second": 1796227810,
"success": 1935,
"errors": 0,
"p50_ms": 15.198,
"p95_ms": 29.387,
"p99_ms": 36.675
},
{
"second": 1796227811,
"success": 1531,
"errors": 0,
"p50_ms": 17.163,
"p95_ms": 45.609,
"p99_ms": 65.233
},
{
"second": 1796227812,
"success": 1076,
"errors": 0,
"p50_ms": 26.944,
"p95_ms": 65.095,
"p99_ms": 80.965
},
{
"second": 1796227813,
"success": 1200,
"errors": 0,
"p50_ms": 22.721,
"p95_ms": 49.735,
"p99_ms": 69.946
},
{
"second": 1796227814,
"success": 1915,
"errors": 0,
"p50_ms": 14.742,
"p95_ms": 32.433,
"p99_ms": 40.814
},
{
"second": 1796227815,
"success": 1955,
"errors": 0,
"p50_ms": 14.9,
"p95_ms": 30.431,
"p99_ms": 37.287
},
{
"second": 1796227816,
"success": 1847,
"errors": 0,
"p50_ms": 15.696,
"p95_ms": 33.639,
"p99_ms": 42.971
},
{
"second": 1796227817,
"success": 1768,
"errors": 0,
"p50_ms": 16.213,
"p95_ms": 36.286,
"p99_ms": 50.768
},
{
"second": 1796227818,
"success": 1499,
"errors": 0,
"p50_ms": 18.513,
"p95_ms": 42.73,
"p99_ms": 53.855
},
{
"second": 1796227819,
"success": 2001,
"errors": 0,
"p50_ms": 14.48,
"p95_ms": 30.163,
"p99_ms": 35.302
},
{
"second": 1796227820,
"success": 1934,
"errors": 0,
"p50_ms": 14.054,
"p95_ms": 37.688,
"p99_ms": 52.18
},
{
"second": 1796227821,
"success": 1756,
"errors": 0,
"p50_ms": 15.806,
"p95_ms": 37.035,
"p99_ms": 54.351
},
{
"second": 1796227822,
"success": 1143,
"errors": 0,
"p50_ms": 24.645,
"p95_ms": 54.745,
"p99_ms": 76.297
},
{
"second": 1796227823,
"success": 1313,
"errors": 0,
"p50_ms": 18.972,
"p95_ms": 52.182,
"p99_ms": 110.76
}
],
"uncertain_retries": 0,
"note": "track1 fixed-r4-rep3; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:10:48.432601Z",
"finished_at": "2026-12-02T16:11:08.448921Z",
"measured_seconds": 20.017,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 30709,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1534.153,
"offered_rps": 1534.153,
"successful_latency_ms": {
"p50": 13.916,
"p95": 56.841,
"p99": 100.619,
"max": 262.62,
"mean": 20.822
},
"status_counts": {
"201": 30709
},
"instances": {
"18c180f5432b": 7677,
"202eaf8fa394": 7677,
"d13a2fadbb13": 7678,
"e2eb68ebefb0": 7677
},
"app_versions": {
"1.0.0": 30709
},
"kinds": {
"write": 30709
},
"series": [
{
"second": 1796227848,
"success": 367,
"errors": 0,
"p50_ms": 30.687,
"p95_ms": 174.157,
"p99_ms": 214.668
},
{
"second": 1796227849,
"success": 1196,
"errors": 0,
"p50_ms": 16.575,
"p95_ms": 83.494,
"p99_ms": 120.848
},
{
"second": 1796227850,
"success": 1931,
"errors": 0,
"p50_ms": 12.464,
"p95_ms": 44.376,
"p99_ms": 53.5
},
{
"second": 1796227851,
"success": 1768,
"errors": 0,
"p50_ms": 13.153,
"p95_ms": 50.32,
"p99_ms": 65.099
},
{
"second": 1796227852,
"success": 1588,
"errors": 0,
"p50_ms": 13.243,
"p95_ms": 63.412,
"p99_ms": 83.198
},
{
"second": 1796227853,
"success": 1683,
"errors": 0,
"p50_ms": 14.337,
"p95_ms": 46.384,
"p99_ms": 60.29
},
{
"second": 1796227854,
"success": 1808,
"errors": 0,
"p50_ms": 14.026,
"p95_ms": 42.84,
"p99_ms": 51.306
},
{
"second": 1796227855,
"success": 1700,
"errors": 0,
"p50_ms": 13.27,
"p95_ms": 50.086,
"p99_ms": 73.354
},
{
"second": 1796227856,
"success": 1917,
"errors": 0,
"p50_ms": 12.246,
"p95_ms": 44.828,
"p99_ms": 53.957
},
{
"second": 1796227857,
"success": 1649,
"errors": 0,
"p50_ms": 13.994,
"p95_ms": 51.621,
"p99_ms": 181.335
},
{
"second": 1796227858,
"success": 894,
"errors": 0,
"p50_ms": 17.027,
"p95_ms": 105.11,
"p99_ms": 196.522
},
{
"second": 1796227859,
"success": 1074,
"errors": 0,
"p50_ms": 19.769,
"p95_ms": 82.15,
"p99_ms": 125.127
},
{
"second": 1796227860,
"success": 1514,
"errors": 0,
"p50_ms": 16.712,
"p95_ms": 53.154,
"p99_ms": 67.75
},
{
"second": 1796227861,
"success": 1732,
"errors": 0,
"p50_ms": 12.612,
"p95_ms": 48.293,
"p99_ms": 103.553
},
{
"second": 1796227862,
"success": 1889,
"errors": 0,
"p50_ms": 12.872,
"p95_ms": 47.807,
"p99_ms": 60.789
},
{
"second": 1796227863,
"success": 1368,
"errors": 0,
"p50_ms": 15.965,
"p95_ms": 72.863,
"p99_ms": 146.372
},
{
"second": 1796227864,
"success": 891,
"errors": 0,
"p50_ms": 17.645,
"p95_ms": 113.088,
"p99_ms": 217.64
},
{
"second": 1796227865,
"success": 1814,
"errors": 0,
"p50_ms": 13.196,
"p95_ms": 48.889,
"p99_ms": 70.76
},
{
"second": 1796227866,
"success": 1796,
"errors": 0,
"p50_ms": 13.762,
"p95_ms": 45.966,
"p99_ms": 58.092
},
{
"second": 1796227867,
"success": 1675,
"errors": 0,
"p50_ms": 13.016,
"p95_ms": 55.143,
"p99_ms": 74.555
},
{
"second": 1796227868,
"success": 455,
"errors": 0,
"p50_ms": 21.64,
"p95_ms": 83.515,
"p99_ms": 107.025
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p4-rep1; replicas=4 cpu_per=0.1 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:12:58.12449Z",
"finished_at": "2026-12-02T16:13:18.14482Z",
"measured_seconds": 20.021,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 30847,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1540.739,
"offered_rps": 1540.739,
"successful_latency_ms": {
"p50": 14.187,
"p95": 55.904,
"p99": 95.329,
"max": 285.496,
"mean": 20.711
},
"status_counts": {
"201": 30847
},
"instances": {
"3167c76b1d1d": 7712,
"8e476726e9f3": 7711,
"b1cb56822ef0": 7712,
"db34b7c15227": 7712
},
"app_versions": {
"1.0.0": 30847
},
"kinds": {
"write": 30847
},
"series": [
{
"second": 1796227978,
"success": 1257,
"errors": 0,
"p50_ms": 15.157,
"p95_ms": 57.533,
"p99_ms": 99.86
},
{
"second": 1796227979,
"success": 1967,
"errors": 0,
"p50_ms": 11.806,
"p95_ms": 45.291,
"p99_ms": 62.426
},
{
"second": 1796227980,
"success": 1995,
"errors": 0,
"p50_ms": 11.968,
"p95_ms": 43.158,
"p99_ms": 55.256
},
{
"second": 1796227981,
"success": 1878,
"errors": 0,
"p50_ms": 11.685,
"p95_ms": 45.417,
"p99_ms": 71.556
},
{
"second": 1796227982,
"success": 1697,
"errors": 0,
"p50_ms": 13.26,
"p95_ms": 50.897,
"p99_ms": 73.434
},
{
"second": 1796227983,
"success": 1118,
"errors": 0,
"p50_ms": 23.062,
"p95_ms": 63.474,
"p99_ms": 95.349
},
{
"second": 1796227984,
"success": 1540,
"errors": 0,
"p50_ms": 16.199,
"p95_ms": 51.427,
"p99_ms": 60.832
},
{
"second": 1796227985,
"success": 1578,
"errors": 0,
"p50_ms": 13.591,
"p95_ms": 54.764,
"p99_ms": 99.787
},
{
"second": 1796227986,
"success": 1781,
"errors": 0,
"p50_ms": 12.548,
"p95_ms": 48.858,
"p99_ms": 85.51
},
{
"second": 1796227987,
"success": 1105,
"errors": 0,
"p50_ms": 17.102,
"p95_ms": 100.016,
"p99_ms": 156.524
},
{
"second": 1796227988,
"success": 975,
"errors": 0,
"p50_ms": 17.922,
"p95_ms": 95.588,
"p99_ms": 242.256
},
{
"second": 1796227989,
"success": 1611,
"errors": 0,
"p50_ms": 15.741,
"p95_ms": 49.215,
"p99_ms": 62.275
},
{
"second": 1796227990,
"success": 1979,
"errors": 0,
"p50_ms": 12.556,
"p95_ms": 38.867,
"p99_ms": 63.856
},
{
"second": 1796227991,
"success": 1708,
"errors": 0,
"p50_ms": 11.5,
"p95_ms": 55.827,
"p99_ms": 123.894
},
{
"second": 1796227992,
"success": 1201,
"errors": 0,
"p50_ms": 20.489,
"p95_ms": 66.65,
"p99_ms": 87.984
},
{
"second": 1796227993,
"success": 1078,
"errors": 0,
"p50_ms": 20.641,
"p95_ms": 80.891,
"p99_ms": 131.111
},
{
"second": 1796227994,
"success": 1385,
"errors": 0,
"p50_ms": 15.484,
"p95_ms": 63.432,
"p99_ms": 107.13
},
{
"second": 1796227995,
"success": 1789,
"errors": 0,
"p50_ms": 13.266,
"p95_ms": 43.549,
"p99_ms": 52.757
},
{
"second": 1796227996,
"success": 2002,
"errors": 0,
"p50_ms": 11.911,
"p95_ms": 42.67,
"p99_ms": 56.768
},
{
"second": 1796227997,
"success": 1086,
"errors": 0,
"p50_ms": 20.469,
"p95_ms": 81.846,
"p99_ms": 155.961
},
{
"second": 1796227998,
"success": 117,
"errors": 0,
"p50_ms": 19.821,
"p95_ms": 86.297,
"p99_ms": 98.139
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p4-rep2; replicas=4 cpu_per=0.1 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:15:12.479805Z",
"finished_at": "2026-12-02T16:15:32.504838Z",
"measured_seconds": 20.025,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 22173,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1107.248,
"offered_rps": 1107.248,
"successful_latency_ms": {
"p50": 18.053,
"p95": 86.177,
"p99": 172.694,
"max": 594.562,
"mean": 28.817
},
"status_counts": {
"201": 22173
},
"instances": {
"093f0b694c95": 5543,
"34699568f1ca": 5544,
"84aa394e5bda": 5543,
"efa72385b419": 5543
},
"app_versions": {
"1.0.0": 22173
},
"kinds": {
"write": 22173
},
"series": [
{
"second": 1796228112,
"success": 476,
"errors": 0,
"p50_ms": 25.516,
"p95_ms": 83.944,
"p99_ms": 106.811
},
{
"second": 1796228113,
"success": 1016,
"errors": 0,
"p50_ms": 22.888,
"p95_ms": 94.826,
"p99_ms": 164.299
},
{
"second": 1796228114,
"success": 772,
"errors": 0,
"p50_ms": 12.949,
"p95_ms": 152.897,
"p99_ms": 206.081
},
{
"second": 1796228115,
"success": 1574,
"errors": 0,
"p50_ms": 15.16,
"p95_ms": 55.906,
"p99_ms": 67.6
},
{
"second": 1796228116,
"success": 1178,
"errors": 0,
"p50_ms": 19.504,
"p95_ms": 65.28,
"p99_ms": 120.796
},
{
"second": 1796228117,
"success": 1624,
"errors": 0,
"p50_ms": 12.035,
"p95_ms": 62.624,
"p99_ms": 92.486
},
{
"second": 1796228118,
"success": 1728,
"errors": 0,
"p50_ms": 13.582,
"p95_ms": 50.758,
"p99_ms": 69.491
},
{
"second": 1796228119,
"success": 1550,
"errors": 0,
"p50_ms": 16.772,
"p95_ms": 48.864,
"p99_ms": 61.091
},
{
"second": 1796228120,
"success": 338,
"errors": 0,
"p50_ms": 69.147,
"p95_ms": 414.49,
"p99_ms": 534.99
},
{
"second": 1796228121,
"success": 587,
"errors": 0,
"p50_ms": 28.01,
"p95_ms": 179.69,
"p99_ms": 264.446
},
{
"second": 1796228122,
"success": 1104,
"errors": 0,
"p50_ms": 23.129,
"p95_ms": 73.92,
"p99_ms": 100.175
},
{
"second": 1796228123,
"success": 1428,
"errors": 0,
"p50_ms": 16.342,
"p95_ms": 59.702,
"p99_ms": 168.025
},
{
"second": 1796228124,
"success": 768,
"errors": 0,
"p50_ms": 27.032,
"p95_ms": 118.227,
"p99_ms": 199.21
},
{
"second": 1796228125,
"success": 660,
"errors": 0,
"p50_ms": 31.559,
"p95_ms": 130.278,
"p99_ms": 267.197
},
{
"second": 1796228126,
"success": 764,
"errors": 0,
"p50_ms": 20.445,
"p95_ms": 133.496,
"p99_ms": 286.489
},
{
"second": 1796228127,
"success": 632,
"errors": 0,
"p50_ms": 25.984,
"p95_ms": 161.471,
"p99_ms": 201.691
},
{
"second": 1796228128,
"success": 749,
"errors": 0,
"p50_ms": 25.606,
"p95_ms": 146.212,
"p99_ms": 200.499
},
{
"second": 1796228129,
"success": 1512,
"errors": 0,
"p50_ms": 16.696,
"p95_ms": 50.998,
"p99_ms": 62.414
},
{
"second": 1796228130,
"success": 1490,
"errors": 0,
"p50_ms": 14.696,
"p95_ms": 61.241,
"p99_ms": 91.944
},
{
"second": 1796228131,
"success": 1757,
"errors": 0,
"p50_ms": 14.002,
"p95_ms": 47.69,
"p99_ms": 62.265
},
{
"second": 1796228132,
"success": 466,
"errors": 0,
"p50_ms": 30.762,
"p95_ms": 66.261,
"p99_ms": 82.72
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p4-rep3; replicas=4 cpu_per=0.1 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:11:32.130732Z",
"finished_at": "2026-12-02T16:11:52.143296Z",
"measured_seconds": 20.013,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 26769,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1337.571,
"offered_rps": 1337.571,
"successful_latency_ms": {
"p50": 18.116,
"p95": 57.78,
"p99": 107.192,
"max": 291.262,
"mean": 23.905
},
"status_counts": {
"201": 26769
},
"instances": {
"9b166b35d577": 6693,
"a9c166f5d5de": 6692,
"ad2bc8c763f7": 6692,
"e559b6a3b19b": 6692
},
"app_versions": {
"1.0.0": 26769
},
"kinds": {
"write": 26769
},
"series": [
{
"second": 1796227892,
"success": 1740,
"errors": 0,
"p50_ms": 14.832,
"p95_ms": 28.32,
"p99_ms": 35.462
},
{
"second": 1796227893,
"success": 1581,
"errors": 0,
"p50_ms": 15.931,
"p95_ms": 48.265,
"p99_ms": 63.331
},
{
"second": 1796227894,
"success": 1826,
"errors": 0,
"p50_ms": 14.546,
"p95_ms": 38.478,
"p99_ms": 49.106
},
{
"second": 1796227895,
"success": 1948,
"errors": 0,
"p50_ms": 14.545,
"p95_ms": 33.825,
"p99_ms": 42.848
},
{
"second": 1796227896,
"success": 1577,
"errors": 0,
"p50_ms": 17.858,
"p95_ms": 39.329,
"p99_ms": 53.734
},
{
"second": 1796227897,
"success": 1752,
"errors": 0,
"p50_ms": 16.886,
"p95_ms": 35.17,
"p99_ms": 44.176
},
{
"second": 1796227898,
"success": 1141,
"errors": 0,
"p50_ms": 17.885,
"p95_ms": 86.236,
"p99_ms": 160.977
},
{
"second": 1796227899,
"success": 873,
"errors": 0,
"p50_ms": 30.647,
"p95_ms": 83.153,
"p99_ms": 135.496
},
{
"second": 1796227900,
"success": 1036,
"errors": 0,
"p50_ms": 26.66,
"p95_ms": 60.732,
"p99_ms": 83.299
},
{
"second": 1796227901,
"success": 1620,
"errors": 0,
"p50_ms": 18.046,
"p95_ms": 37.045,
"p99_ms": 50.95
},
{
"second": 1796227902,
"success": 2032,
"errors": 0,
"p50_ms": 13.661,
"p95_ms": 34.367,
"p99_ms": 42.126
},
{
"second": 1796227903,
"success": 1294,
"errors": 0,
"p50_ms": 19.468,
"p95_ms": 61.305,
"p99_ms": 84.495
},
{
"second": 1796227904,
"success": 434,
"errors": 0,
"p50_ms": 61.845,
"p95_ms": 172.387,
"p99_ms": 214.977
},
{
"second": 1796227905,
"success": 936,
"errors": 0,
"p50_ms": 29.213,
"p95_ms": 69.721,
"p99_ms": 105.95
},
{
"second": 1796227906,
"success": 647,
"errors": 0,
"p50_ms": 46.278,
"p95_ms": 96.894,
"p99_ms": 142.575
},
{
"second": 1796227907,
"success": 674,
"errors": 0,
"p50_ms": 37.887,
"p95_ms": 126.002,
"p99_ms": 163.23
},
{
"second": 1796227908,
"success": 995,
"errors": 0,
"p50_ms": 26.13,
"p95_ms": 67.071,
"p99_ms": 101.425
},
{
"second": 1796227909,
"success": 958,
"errors": 0,
"p50_ms": 29.106,
"p95_ms": 70.714,
"p99_ms": 99.98
},
{
"second": 1796227910,
"success": 1670,
"errors": 0,
"p50_ms": 16.52,
"p95_ms": 40.611,
"p99_ms": 52.27
},
{
"second": 1796227911,
"success": 1826,
"errors": 0,
"p50_ms": 15.879,
"p95_ms": 33.043,
"p99_ms": 44.428
},
{
"second": 1796227912,
"success": 209,
"errors": 0,
"p50_ms": 19.796,
"p95_ms": 32.13,
"p99_ms": 34.783
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p7-rep1; replicas=4 cpu_per=0.175 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:13:43.54441Z",
"finished_at": "2026-12-02T16:14:03.551312Z",
"measured_seconds": 20.007,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 25877,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1293.366,
"offered_rps": 1293.366,
"successful_latency_ms": {
"p50": 21.358,
"p95": 51.369,
"p99": 75.526,
"max": 157.592,
"mean": 24.703
},
"status_counts": {
"201": 25877
},
"instances": {
"30464c944173": 6469,
"8fd2c7848906": 6469,
"e86edb3d0aca": 6470,
"f4f8acb59101": 6469
},
"app_versions": {
"1.0.0": 25877
},
"kinds": {
"write": 25877
},
"series": [
{
"second": 1796228023,
"success": 357,
"errors": 0,
"p50_ms": 33.418,
"p95_ms": 94.669,
"p99_ms": 109.087
},
{
"second": 1796228024,
"success": 815,
"errors": 0,
"p50_ms": 32.605,
"p95_ms": 99.124,
"p99_ms": 117.621
},
{
"second": 1796228025,
"success": 852,
"errors": 0,
"p50_ms": 31.114,
"p95_ms": 80.604,
"p99_ms": 109.877
},
{
"second": 1796228026,
"success": 978,
"errors": 0,
"p50_ms": 28.461,
"p95_ms": 65.88,
"p99_ms": 98.469
},
{
"second": 1796228027,
"success": 1236,
"errors": 0,
"p50_ms": 23.616,
"p95_ms": 51.223,
"p99_ms": 63.573
},
{
"second": 1796228028,
"success": 1276,
"errors": 0,
"p50_ms": 23.156,
"p95_ms": 46.619,
"p99_ms": 59.465
},
{
"second": 1796228029,
"success": 1290,
"errors": 0,
"p50_ms": 22.277,
"p95_ms": 48.941,
"p99_ms": 67.118
},
{
"second": 1796228030,
"success": 1051,
"errors": 0,
"p50_ms": 26.953,
"p95_ms": 61.642,
"p99_ms": 74.548
},
{
"second": 1796228031,
"success": 1284,
"errors": 0,
"p50_ms": 22.659,
"p95_ms": 44.959,
"p99_ms": 56.596
},
{
"second": 1796228032,
"success": 1384,
"errors": 0,
"p50_ms": 20.947,
"p95_ms": 45.701,
"p99_ms": 60.035
},
{
"second": 1796228033,
"success": 1614,
"errors": 0,
"p50_ms": 17.828,
"p95_ms": 36.051,
"p99_ms": 45.169
},
{
"second": 1796228034,
"success": 1286,
"errors": 0,
"p50_ms": 21.829,
"p95_ms": 55.084,
"p99_ms": 80.521
},
{
"second": 1796228035,
"success": 1458,
"errors": 0,
"p50_ms": 20.128,
"p95_ms": 40.503,
"p99_ms": 50.239
},
{
"second": 1796228036,
"success": 1685,
"errors": 0,
"p50_ms": 17.35,
"p95_ms": 35.805,
"p99_ms": 45.682
},
{
"second": 1796228037,
"success": 1670,
"errors": 0,
"p50_ms": 17.572,
"p95_ms": 35.099,
"p99_ms": 44.121
},
{
"second": 1796228038,
"success": 1179,
"errors": 0,
"p50_ms": 25.063,
"p95_ms": 51.79,
"p99_ms": 65.043
},
{
"second": 1796228039,
"success": 979,
"errors": 0,
"p50_ms": 29.681,
"p95_ms": 63.112,
"p99_ms": 78.448
},
{
"second": 1796228040,
"success": 1501,
"errors": 0,
"p50_ms": 19.448,
"p95_ms": 38.582,
"p99_ms": 48.189
},
{
"second": 1796228041,
"success": 1633,
"errors": 0,
"p50_ms": 17.1,
"p95_ms": 39.614,
"p99_ms": 51.797
},
{
"second": 1796228042,
"success": 1499,
"errors": 0,
"p50_ms": 19.108,
"p95_ms": 42.661,
"p99_ms": 56.242
},
{
"second": 1796228043,
"success": 850,
"errors": 0,
"p50_ms": 18.198,
"p95_ms": 36.892,
"p99_ms": 46.811
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p7-rep2; replicas=4 cpu_per=0.175 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:15:56.669417Z",
"finished_at": "2026-12-02T16:16:16.69211Z",
"measured_seconds": 20.023,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 13649,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 681.667,
"offered_rps": 681.667,
"successful_latency_ms": {
"p50": 35.476,
"p95": 121.107,
"p99": 200.148,
"max": 390.255,
"mean": 46.858
},
"status_counts": {
"201": 13649
},
"instances": {
"31768aeb4eab": 3412,
"82f3383a8fce": 3412,
"f7a4c2fb7074": 3413,
"fb71ac9c2872": 3412
},
"app_versions": {
"1.0.0": 13649
},
"kinds": {
"write": 13649
},
"series": [
{
"second": 1796228156,
"success": 539,
"errors": 0,
"p50_ms": 16.261,
"p95_ms": 37.462,
"p99_ms": 44.381
},
{
"second": 1796228157,
"success": 1522,
"errors": 0,
"p50_ms": 17.837,
"p95_ms": 46.974,
"p99_ms": 68.382
},
{
"second": 1796228158,
"success": 795,
"errors": 0,
"p50_ms": 31.471,
"p95_ms": 116.242,
"p99_ms": 168.524
},
{
"second": 1796228159,
"success": 273,
"errors": 0,
"p50_ms": 95.924,
"p95_ms": 249.415,
"p99_ms": 331.825
},
{
"second": 1796228160,
"success": 431,
"errors": 0,
"p50_ms": 67.32,
"p95_ms": 172.679,
"p99_ms": 249.311
},
{
"second": 1796228161,
"success": 552,
"errors": 0,
"p50_ms": 46.203,
"p95_ms": 116.5,
"p99_ms": 151.851
},
{
"second": 1796228162,
"success": 916,
"errors": 0,
"p50_ms": 28.782,
"p95_ms": 70.638,
"p99_ms": 152.05
},
{
"second": 1796228163,
"success": 1169,
"errors": 0,
"p50_ms": 25.429,
"p95_ms": 56.766,
"p99_ms": 69.838
},
{
"second": 1796228164,
"success": 632,
"errors": 0,
"p50_ms": 36.745,
"p95_ms": 140.344,
"p99_ms": 207.509
},
{
"second": 1796228165,
"success": 559,
"errors": 0,
"p50_ms": 45.657,
"p95_ms": 149.001,
"p99_ms": 174.05
},
{
"second": 1796228166,
"success": 698,
"errors": 0,
"p50_ms": 40.524,
"p95_ms": 89.03,
"p99_ms": 110.71
},
{
"second": 1796228167,
"success": 1054,
"errors": 0,
"p50_ms": 27.405,
"p95_ms": 58.863,
"p99_ms": 80.335
},
{
"second": 1796228168,
"success": 484,
"errors": 0,
"p50_ms": 58.756,
"p95_ms": 140.448,
"p99_ms": 175.582
},
{
"second": 1796228169,
"success": 463,
"errors": 0,
"p50_ms": 55.089,
"p95_ms": 164.846,
"p99_ms": 298.149
},
{
"second": 1796228170,
"success": 407,
"errors": 0,
"p50_ms": 74.85,
"p95_ms": 147.13,
"p99_ms": 198.818
},
{
"second": 1796228171,
"success": 616,
"errors": 0,
"p50_ms": 47.812,
"p95_ms": 103.607,
"p99_ms": 123.866
},
{
"second": 1796228172,
"success": 418,
"errors": 0,
"p50_ms": 57.685,
"p95_ms": 183.896,
"p99_ms": 231.424
},
{
"second": 1796228173,
"success": 786,
"errors": 0,
"p50_ms": 40.912,
"p95_ms": 75.071,
"p99_ms": 94.449
},
{
"second": 1796228174,
"success": 622,
"errors": 0,
"p50_ms": 42.799,
"p95_ms": 117.876,
"p99_ms": 156.682
},
{
"second": 1796228175,
"success": 394,
"errors": 0,
"p50_ms": 56.803,
"p95_ms": 238.183,
"p99_ms": 319.311
},
{
"second": 1796228176,
"success": 319,
"errors": 0,
"p50_ms": 63.041,
"p95_ms": 119.172,
"p99_ms": 136.525
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p7-rep3; replicas=4 cpu_per=0.175 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:12:15.566789Z",
"finished_at": "2026-12-02T16:12:35.574895Z",
"measured_seconds": 20.009,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 34560,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1727.249,
"offered_rps": 1727.249,
"successful_latency_ms": {
"p50": 15.614,
"p95": 38.122,
"p99": 61.903,
"max": 203.609,
"mean": 18.511
},
"status_counts": {
"201": 34560
},
"instances": {
"46d23af6e58c": 8641,
"5d6acf8c3cc8": 8640,
"c6f46393d117": 8640,
"f4dcef6538ad": 8639
},
"app_versions": {
"1.0.0": 34560
},
"kinds": {
"write": 34560
},
"series": [
{
"second": 1796227935,
"success": 698,
"errors": 0,
"p50_ms": 18.232,
"p95_ms": 35.602,
"p99_ms": 43.182
},
{
"second": 1796227936,
"success": 1861,
"errors": 0,
"p50_ms": 15.513,
"p95_ms": 32.474,
"p99_ms": 42.559
},
{
"second": 1796227937,
"success": 1557,
"errors": 0,
"p50_ms": 16.458,
"p95_ms": 43.991,
"p99_ms": 63.233
},
{
"second": 1796227938,
"success": 1965,
"errors": 0,
"p50_ms": 14.439,
"p95_ms": 31.887,
"p99_ms": 39.891
},
{
"second": 1796227939,
"success": 2003,
"errors": 0,
"p50_ms": 14.208,
"p95_ms": 30.942,
"p99_ms": 40.095
},
{
"second": 1796227940,
"success": 1861,
"errors": 0,
"p50_ms": 14.908,
"p95_ms": 34.213,
"p99_ms": 45.147
},
{
"second": 1796227941,
"success": 1878,
"errors": 0,
"p50_ms": 15.151,
"p95_ms": 32.059,
"p99_ms": 42.649
},
{
"second": 1796227942,
"success": 1667,
"errors": 0,
"p50_ms": 15.325,
"p95_ms": 45.849,
"p99_ms": 61.665
},
{
"second": 1796227943,
"success": 1180,
"errors": 0,
"p50_ms": 21.317,
"p95_ms": 76.614,
"p99_ms": 100.829
},
{
"second": 1796227944,
"success": 1265,
"errors": 0,
"p50_ms": 19.549,
"p95_ms": 55.758,
"p99_ms": 100.659
},
{
"second": 1796227945,
"success": 2060,
"errors": 0,
"p50_ms": 14.175,
"p95_ms": 29.076,
"p99_ms": 39.354
},
{
"second": 1796227946,
"success": 1984,
"errors": 0,
"p50_ms": 14.925,
"p95_ms": 29.164,
"p99_ms": 40.051
},
{
"second": 1796227947,
"success": 1789,
"errors": 0,
"p50_ms": 14.835,
"p95_ms": 38.084,
"p99_ms": 69.151
},
{
"second": 1796227948,
"success": 1654,
"errors": 0,
"p50_ms": 16.582,
"p95_ms": 40.579,
"p99_ms": 59.67
},
{
"second": 1796227949,
"success": 2067,
"errors": 0,
"p50_ms": 13.234,
"p95_ms": 30.605,
"p99_ms": 44.743
},
{
"second": 1796227950,
"success": 2007,
"errors": 0,
"p50_ms": 14.086,
"p95_ms": 31.874,
"p99_ms": 45.322
},
{
"second": 1796227951,
"success": 1815,
"errors": 0,
"p50_ms": 16.748,
"p95_ms": 30.361,
"p99_ms": 35.699
},
{
"second": 1796227952,
"success": 1798,
"errors": 0,
"p50_ms": 15.644,
"p95_ms": 35.719,
"p99_ms": 47.965
},
{
"second": 1796227953,
"success": 1234,
"errors": 0,
"p50_ms": 21.498,
"p95_ms": 57.107,
"p99_ms": 95.418
},
{
"second": 1796227954,
"success": 1179,
"errors": 0,
"p50_ms": 21.993,
"p95_ms": 61.855,
"p99_ms": 95.668
},
{
"second": 1796227955,
"success": 1038,
"errors": 0,
"p50_ms": 15.64,
"p95_ms": 33.063,
"p99_ms": 41.734
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p9-rep1; replicas=4 cpu_per=0.225 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:14:27.074294Z",
"finished_at": "2026-12-02T16:14:47.083834Z",
"measured_seconds": 20.01,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 30964,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1547.416,
"offered_rps": 1547.416,
"successful_latency_ms": {
"p50": 16.88,
"p95": 45.471,
"p99": 70.47,
"max": 220.303,
"mean": 20.667
},
"status_counts": {
"201": 30964
},
"instances": {
"985df5c197af": 7741,
"acb023d8ddc0": 7741,
"d00ce9e36f75": 7741,
"f1fc4534b6bc": 7741
},
"app_versions": {
"1.0.0": 30964
},
"kinds": {
"write": 30964
},
"series": [
{
"second": 1796228067,
"success": 1557,
"errors": 0,
"p50_ms": 17.318,
"p95_ms": 36.423,
"p99_ms": 46.163
},
{
"second": 1796228068,
"success": 1940,
"errors": 0,
"p50_ms": 14.382,
"p95_ms": 32.209,
"p99_ms": 42.339
},
{
"second": 1796228069,
"success": 1928,
"errors": 0,
"p50_ms": 13.963,
"p95_ms": 35.099,
"p99_ms": 46.85
},
{
"second": 1796228070,
"success": 1438,
"errors": 0,
"p50_ms": 17.395,
"p95_ms": 50.487,
"p99_ms": 69.214
},
{
"second": 1796228071,
"success": 2081,
"errors": 0,
"p50_ms": 13.354,
"p95_ms": 33.715,
"p99_ms": 41.881
},
{
"second": 1796228072,
"success": 2030,
"errors": 0,
"p50_ms": 13.496,
"p95_ms": 33.782,
"p99_ms": 47.339
},
{
"second": 1796228073,
"success": 1957,
"errors": 0,
"p50_ms": 15.048,
"p95_ms": 31.376,
"p99_ms": 43.268
},
{
"second": 1796228074,
"success": 1883,
"errors": 0,
"p50_ms": 15.049,
"p95_ms": 33.273,
"p99_ms": 44.434
},
{
"second": 1796228075,
"success": 1427,
"errors": 0,
"p50_ms": 18.396,
"p95_ms": 44.48,
"p99_ms": 110.733
},
{
"second": 1796228076,
"success": 1044,
"errors": 0,
"p50_ms": 26.129,
"p95_ms": 67.286,
"p99_ms": 84.63
},
{
"second": 1796228077,
"success": 1160,
"errors": 0,
"p50_ms": 21.971,
"p95_ms": 67.368,
"p99_ms": 95.324
},
{
"second": 1796228078,
"success": 1524,
"errors": 0,
"p50_ms": 18.755,
"p95_ms": 40.855,
"p99_ms": 55.513
},
{
"second": 1796228079,
"success": 1665,
"errors": 0,
"p50_ms": 16.876,
"p95_ms": 37.164,
"p99_ms": 48.102
},
{
"second": 1796228080,
"success": 1698,
"errors": 0,
"p50_ms": 17.325,
"p95_ms": 36.078,
"p99_ms": 44.897
},
{
"second": 1796228081,
"success": 1284,
"errors": 0,
"p50_ms": 22.355,
"p95_ms": 47.442,
"p99_ms": 75.476
},
{
"second": 1796228082,
"success": 980,
"errors": 0,
"p50_ms": 28.763,
"p95_ms": 68.749,
"p99_ms": 99.488
},
{
"second": 1796228083,
"success": 817,
"errors": 0,
"p50_ms": 29.98,
"p95_ms": 93.693,
"p99_ms": 134.484
},
{
"second": 1796228084,
"success": 1657,
"errors": 0,
"p50_ms": 16.357,
"p95_ms": 40.879,
"p99_ms": 54.556
},
{
"second": 1796228085,
"success": 1738,
"errors": 0,
"p50_ms": 14.759,
"p95_ms": 42.735,
"p99_ms": 62.225
},
{
"second": 1796228086,
"success": 1076,
"errors": 0,
"p50_ms": 25.724,
"p95_ms": 62.174,
"p99_ms": 82.606
},
{
"second": 1796228087,
"success": 80,
"errors": 0,
"p50_ms": 22.868,
"p95_ms": 46.378,
"p99_ms": 62.206
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p9-rep2; replicas=4 cpu_per=0.225 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
+212
View File
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:16:53.110034Z",
"finished_at": "2026-12-02T16:17:13.139014Z",
"measured_seconds": 20.029,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 15496,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 773.668,
"offered_rps": 773.668,
"successful_latency_ms": {
"p50": 33.876,
"p95": 93.239,
"p99": 138.637,
"max": 319.585,
"mean": 41.314
},
"status_counts": {
"201": 15496
},
"instances": {
"68ebcd12c911": 3874,
"8cd7cdce0d97": 3873,
"99f3e63caa13": 3874,
"cc9f4fdbcec1": 3875
},
"app_versions": {
"1.0.0": 15496
},
"kinds": {
"write": 15496
},
"series": [
{
"second": 1796228213,
"success": 912,
"errors": 0,
"p50_ms": 28.791,
"p95_ms": 60.37,
"p99_ms": 77.378
},
{
"second": 1796228214,
"success": 880,
"errors": 0,
"p50_ms": 30.619,
"p95_ms": 81.272,
"p99_ms": 129.775
},
{
"second": 1796228215,
"success": 581,
"errors": 0,
"p50_ms": 49.63,
"p95_ms": 124.084,
"p99_ms": 164.362
},
{
"second": 1796228216,
"success": 808,
"errors": 0,
"p50_ms": 33.952,
"p95_ms": 71.756,
"p99_ms": 97.366
},
{
"second": 1796228217,
"success": 998,
"errors": 0,
"p50_ms": 28.312,
"p95_ms": 64.703,
"p99_ms": 93.639
},
{
"second": 1796228218,
"success": 1142,
"errors": 0,
"p50_ms": 25.958,
"p95_ms": 50.317,
"p99_ms": 64.718
},
{
"second": 1796228219,
"success": 643,
"errors": 0,
"p50_ms": 48.843,
"p95_ms": 111.1,
"p99_ms": 135.388
},
{
"second": 1796228220,
"success": 613,
"errors": 0,
"p50_ms": 43.058,
"p95_ms": 116.043,
"p99_ms": 148.995
},
{
"second": 1796228221,
"success": 510,
"errors": 0,
"p50_ms": 42.773,
"p95_ms": 255.941,
"p99_ms": 289.481
},
{
"second": 1796228222,
"success": 1083,
"errors": 0,
"p50_ms": 27.377,
"p95_ms": 57.726,
"p99_ms": 68.928
},
{
"second": 1796228223,
"success": 1089,
"errors": 0,
"p50_ms": 25.572,
"p95_ms": 55.086,
"p99_ms": 72.79
},
{
"second": 1796228224,
"success": 750,
"errors": 0,
"p50_ms": 32.906,
"p95_ms": 97.87,
"p99_ms": 127.506
},
{
"second": 1796228225,
"success": 722,
"errors": 0,
"p50_ms": 39.781,
"p95_ms": 86.967,
"p99_ms": 113.091
},
{
"second": 1796228226,
"success": 662,
"errors": 0,
"p50_ms": 44.658,
"p95_ms": 115.335,
"p99_ms": 165.072
},
{
"second": 1796228227,
"success": 513,
"errors": 0,
"p50_ms": 46.753,
"p95_ms": 173.356,
"p99_ms": 267.81
},
{
"second": 1796228228,
"success": 775,
"errors": 0,
"p50_ms": 31.882,
"p95_ms": 108.208,
"p99_ms": 121.92
},
{
"second": 1796228229,
"success": 764,
"errors": 0,
"p50_ms": 37.354,
"p95_ms": 85.62,
"p99_ms": 114.596
},
{
"second": 1796228230,
"success": 639,
"errors": 0,
"p50_ms": 44.472,
"p95_ms": 106.716,
"p99_ms": 147.757
},
{
"second": 1796228231,
"success": 611,
"errors": 0,
"p50_ms": 43.966,
"p95_ms": 124.475,
"p99_ms": 171.954
},
{
"second": 1796228232,
"success": 724,
"errors": 0,
"p50_ms": 37.704,
"p95_ms": 95.912,
"p99_ms": 114.552
},
{
"second": 1796228233,
"success": 77,
"errors": 0,
"p50_ms": 31.326,
"p95_ms": 89.936,
"p99_ms": 97.282
}
],
"uncertain_retries": 0,
"note": "track1 growth-cpu0p9-rep3; replicas=4 cpu_per=0.225 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:17:49.360668Z",
"finished_at": "2026-12-02T16:18:09.371106Z",
"measured_seconds": 20.011,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 20454,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1022.152,
"offered_rps": 1022.152,
"successful_latency_ms": {
"p50": 22.583,
"p95": 78.461,
"p99": 188.85,
"max": 443.872,
"mean": 31.242
},
"status_counts": {
"201": 20454
},
"instances": {
"07be90451f02": 5113,
"2b41152a3783": 5114,
"9f14b44109a5": 5113,
"eb5eb5c37ff3": 5114
},
"app_versions": {
"1.0.0-baseline": 20454
},
"kinds": {
"write": 20454
},
"series": [
{
"second": 1796228269,
"success": 1020,
"errors": 0,
"p50_ms": 17.038,
"p95_ms": 40.807,
"p99_ms": 47.433
},
{
"second": 1796228270,
"success": 1644,
"errors": 0,
"p50_ms": 16.164,
"p95_ms": 37.332,
"p99_ms": 148.159
},
{
"second": 1796228271,
"success": 316,
"errors": 0,
"p50_ms": 68.532,
"p95_ms": 302.838,
"p99_ms": 380.572
},
{
"second": 1796228272,
"success": 231,
"errors": 0,
"p50_ms": 131.353,
"p95_ms": 290.259,
"p99_ms": 341.268
},
{
"second": 1796228273,
"success": 746,
"errors": 0,
"p50_ms": 31.404,
"p95_ms": 101.993,
"p99_ms": 175.216
},
{
"second": 1796228274,
"success": 1274,
"errors": 0,
"p50_ms": 23.815,
"p95_ms": 46.758,
"p99_ms": 55.701
},
{
"second": 1796228275,
"success": 1365,
"errors": 0,
"p50_ms": 21.214,
"p95_ms": 42.002,
"p99_ms": 49.685
},
{
"second": 1796228276,
"success": 1106,
"errors": 0,
"p50_ms": 25.368,
"p95_ms": 57.62,
"p99_ms": 75.505
},
{
"second": 1796228277,
"success": 930,
"errors": 0,
"p50_ms": 33.345,
"p95_ms": 63.386,
"p99_ms": 110.341
},
{
"second": 1796228278,
"success": 374,
"errors": 0,
"p50_ms": 64.355,
"p95_ms": 244.132,
"p99_ms": 345.403
},
{
"second": 1796228279,
"success": 303,
"errors": 0,
"p50_ms": 87.776,
"p95_ms": 213.455,
"p99_ms": 258.116
},
{
"second": 1796228280,
"success": 577,
"errors": 0,
"p50_ms": 41.294,
"p95_ms": 147.896,
"p99_ms": 211.467
},
{
"second": 1796228281,
"success": 1074,
"errors": 0,
"p50_ms": 26.594,
"p95_ms": 56.012,
"p99_ms": 75.665
},
{
"second": 1796228282,
"success": 1185,
"errors": 0,
"p50_ms": 23.127,
"p95_ms": 50.561,
"p99_ms": 89.004
},
{
"second": 1796228283,
"success": 1149,
"errors": 0,
"p50_ms": 20.832,
"p95_ms": 56.364,
"p99_ms": 156.012
},
{
"second": 1796228284,
"success": 1479,
"errors": 0,
"p50_ms": 18.72,
"p95_ms": 42.776,
"p99_ms": 49.254
},
{
"second": 1796228285,
"success": 1331,
"errors": 0,
"p50_ms": 20.786,
"p95_ms": 51.169,
"p99_ms": 65.959
},
{
"second": 1796228286,
"success": 1107,
"errors": 0,
"p50_ms": 24.895,
"p95_ms": 62.827,
"p99_ms": 82.956
},
{
"second": 1796228287,
"success": 1149,
"errors": 0,
"p50_ms": 22.14,
"p95_ms": 62.795,
"p99_ms": 113.492
},
{
"second": 1796228288,
"success": 1630,
"errors": 0,
"p50_ms": 17.632,
"p95_ms": 38.606,
"p99_ms": 49.346
},
{
"second": 1796228289,
"success": 464,
"errors": 0,
"p50_ms": 21.044,
"p95_ms": 48.612,
"p99_ms": 65.046
}
],
"uncertain_retries": 0,
"note": "track1 improve-baseline-rep1; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:19:14.340201Z",
"finished_at": "2026-12-02T16:19:34.350477Z",
"measured_seconds": 20.011,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 32619,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 1630.089,
"offered_rps": 1630.089,
"successful_latency_ms": {
"p50": 16.976,
"p95": 39.37,
"p99": 50.719,
"max": 107.364,
"mean": 19.613
},
"status_counts": {
"201": 32619
},
"instances": {
"46388b9acacc": 8155,
"83c3086fcef9": 8155,
"9740bf3d7695": 8154,
"f4d362f2daf6": 8155
},
"app_versions": {
"1.0.0-baseline": 32619
},
"kinds": {
"write": 32619
},
"series": [
{
"second": 1796228354,
"success": 974,
"errors": 0,
"p50_ms": 20.031,
"p95_ms": 38.66,
"p99_ms": 44.097
},
{
"second": 1796228355,
"success": 1797,
"errors": 0,
"p50_ms": 15.998,
"p95_ms": 36.288,
"p99_ms": 45.272
},
{
"second": 1796228356,
"success": 1710,
"errors": 0,
"p50_ms": 16.427,
"p95_ms": 37.904,
"p99_ms": 57.788
},
{
"second": 1796228357,
"success": 1480,
"errors": 0,
"p50_ms": 17.796,
"p95_ms": 41.137,
"p99_ms": 61.941
},
{
"second": 1796228358,
"success": 1567,
"errors": 0,
"p50_ms": 18.423,
"p95_ms": 38.792,
"p99_ms": 51.906
},
{
"second": 1796228359,
"success": 1631,
"errors": 0,
"p50_ms": 16.492,
"p95_ms": 39.196,
"p99_ms": 45.408
},
{
"second": 1796228360,
"success": 1162,
"errors": 0,
"p50_ms": 24.941,
"p95_ms": 53.672,
"p99_ms": 67.58
},
{
"second": 1796228361,
"success": 1169,
"errors": 0,
"p50_ms": 25.264,
"p95_ms": 50.405,
"p99_ms": 62.536
},
{
"second": 1796228362,
"success": 1378,
"errors": 0,
"p50_ms": 19.721,
"p95_ms": 45.636,
"p99_ms": 64.904
},
{
"second": 1796228363,
"success": 1713,
"errors": 0,
"p50_ms": 15.017,
"p95_ms": 40.163,
"p99_ms": 47.362
},
{
"second": 1796228364,
"success": 1843,
"errors": 0,
"p50_ms": 16.424,
"p95_ms": 31.807,
"p99_ms": 38.374
},
{
"second": 1796228365,
"success": 1731,
"errors": 0,
"p50_ms": 15.667,
"p95_ms": 38.145,
"p99_ms": 44.148
},
{
"second": 1796228366,
"success": 1746,
"errors": 0,
"p50_ms": 15.844,
"p95_ms": 38.573,
"p99_ms": 47.551
},
{
"second": 1796228367,
"success": 1545,
"errors": 0,
"p50_ms": 18.918,
"p95_ms": 37.67,
"p99_ms": 51.153
},
{
"second": 1796228368,
"success": 1863,
"errors": 0,
"p50_ms": 14.703,
"p95_ms": 36.558,
"p99_ms": 45.208
},
{
"second": 1796228369,
"success": 1904,
"errors": 0,
"p50_ms": 14.414,
"p95_ms": 34.866,
"p99_ms": 42.629
},
{
"second": 1796228370,
"success": 1761,
"errors": 0,
"p50_ms": 15.858,
"p95_ms": 35.452,
"p99_ms": 42.706
},
{
"second": 1796228371,
"success": 1827,
"errors": 0,
"p50_ms": 15.591,
"p95_ms": 37.518,
"p99_ms": 46.168
},
{
"second": 1796228372,
"success": 1608,
"errors": 0,
"p50_ms": 17.275,
"p95_ms": 40.422,
"p99_ms": 50.296
},
{
"second": 1796228373,
"success": 1616,
"errors": 0,
"p50_ms": 17.883,
"p95_ms": 39.405,
"p99_ms": 47.768
},
{
"second": 1796228374,
"success": 594,
"errors": 0,
"p50_ms": 14.527,
"p95_ms": 41.238,
"p99_ms": 50.59
}
],
"uncertain_retries": 0,
"note": "track1 improve-baseline-rep2; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:20:37.361112Z",
"finished_at": "2026-12-02T16:20:57.368481Z",
"measured_seconds": 20.008,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 43941,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 2196.209,
"offered_rps": 2196.209,
"successful_latency_ms": {
"p50": 12.506,
"p95": 31.402,
"p99": 38.954,
"max": 82.537,
"mean": 14.561
},
"status_counts": {
"201": 43941
},
"instances": {
"231c3645e41b": 10985,
"5e97560d120e": 10986,
"5f7d90661bfd": 10985,
"fe435cf40d67": 10985
},
"app_versions": {
"1.0.0-baseline": 43941
},
"kinds": {
"write": 43941
},
"series": [
{
"second": 1796228437,
"success": 1409,
"errors": 0,
"p50_ms": 12.203,
"p95_ms": 32.461,
"p99_ms": 39.666
},
{
"second": 1796228438,
"success": 2328,
"errors": 0,
"p50_ms": 12.398,
"p95_ms": 28.349,
"p99_ms": 35.771
},
{
"second": 1796228439,
"success": 2362,
"errors": 0,
"p50_ms": 11.402,
"p95_ms": 31.064,
"p99_ms": 36.399
},
{
"second": 1796228440,
"success": 2243,
"errors": 0,
"p50_ms": 12.24,
"p95_ms": 30.629,
"p99_ms": 38.868
},
{
"second": 1796228441,
"success": 2051,
"errors": 0,
"p50_ms": 13.564,
"p95_ms": 31.584,
"p99_ms": 38.255
},
{
"second": 1796228442,
"success": 2198,
"errors": 0,
"p50_ms": 12.66,
"p95_ms": 32.216,
"p99_ms": 37.322
},
{
"second": 1796228443,
"success": 2211,
"errors": 0,
"p50_ms": 12.236,
"p95_ms": 31.915,
"p99_ms": 39.64
},
{
"second": 1796228444,
"success": 2271,
"errors": 0,
"p50_ms": 12.299,
"p95_ms": 29.482,
"p99_ms": 35.928
},
{
"second": 1796228445,
"success": 2190,
"errors": 0,
"p50_ms": 12.775,
"p95_ms": 30.769,
"p99_ms": 35.542
},
{
"second": 1796228446,
"success": 2092,
"errors": 0,
"p50_ms": 12.12,
"p95_ms": 35.953,
"p99_ms": 45.535
},
{
"second": 1796228447,
"success": 2251,
"errors": 0,
"p50_ms": 12.762,
"p95_ms": 28.851,
"p99_ms": 33.381
},
{
"second": 1796228448,
"success": 2190,
"errors": 0,
"p50_ms": 12.987,
"p95_ms": 29.131,
"p99_ms": 36.781
},
{
"second": 1796228449,
"success": 2276,
"errors": 0,
"p50_ms": 11.842,
"p95_ms": 32.7,
"p99_ms": 38.414
},
{
"second": 1796228450,
"success": 2238,
"errors": 0,
"p50_ms": 12.598,
"p95_ms": 30.493,
"p99_ms": 37.224
},
{
"second": 1796228451,
"success": 1955,
"errors": 0,
"p50_ms": 14.126,
"p95_ms": 36.094,
"p99_ms": 44.963
},
{
"second": 1796228452,
"success": 2235,
"errors": 0,
"p50_ms": 12.598,
"p95_ms": 31.363,
"p99_ms": 39.072
},
{
"second": 1796228453,
"success": 2286,
"errors": 0,
"p50_ms": 12.33,
"p95_ms": 29.786,
"p99_ms": 41.829
},
{
"second": 1796228454,
"success": 2219,
"errors": 0,
"p50_ms": 12.432,
"p95_ms": 32.149,
"p99_ms": 38.577
},
{
"second": 1796228455,
"success": 2225,
"errors": 0,
"p50_ms": 12.066,
"p95_ms": 31.466,
"p99_ms": 37.28
},
{
"second": 1796228456,
"success": 1895,
"errors": 0,
"p50_ms": 13.855,
"p95_ms": 36.05,
"p99_ms": 73.133
},
{
"second": 1796228457,
"success": 816,
"errors": 0,
"p50_ms": 13.155,
"p95_ms": 24.185,
"p99_ms": 27.53
}
],
"uncertain_retries": 0,
"note": "track1 improve-baseline-rep3; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:18:32.792075Z",
"finished_at": "2026-12-02T16:18:52.797912Z",
"measured_seconds": 20.006,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 40098,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 2004.286,
"offered_rps": 2004.286,
"successful_latency_ms": {
"p50": 13.502,
"p95": 33.732,
"p99": 44.309,
"max": 110.544,
"mean": 15.956
},
"status_counts": {
"201": 40098
},
"instances": {
"89b7f472af80": 10025,
"954bb9e8b8cb": 10024,
"b1963a924447": 10025,
"d59a7e8fce9c": 10024
},
"app_versions": {
"1.0.0": 40098
},
"kinds": {
"write": 40098
},
"series": [
{
"second": 1796228312,
"success": 468,
"errors": 0,
"p50_ms": 11.656,
"p95_ms": 30.626,
"p99_ms": 34.604
},
{
"second": 1796228313,
"success": 2146,
"errors": 0,
"p50_ms": 13.133,
"p95_ms": 30.883,
"p99_ms": 38.194
},
{
"second": 1796228314,
"success": 1996,
"errors": 0,
"p50_ms": 13.79,
"p95_ms": 34.259,
"p99_ms": 44.314
},
{
"second": 1796228315,
"success": 2208,
"errors": 0,
"p50_ms": 12.265,
"p95_ms": 31.572,
"p99_ms": 37.442
},
{
"second": 1796228316,
"success": 2160,
"errors": 0,
"p50_ms": 13.976,
"p95_ms": 26.711,
"p99_ms": 34.726
},
{
"second": 1796228317,
"success": 1861,
"errors": 0,
"p50_ms": 14.126,
"p95_ms": 37.406,
"p99_ms": 50.236
},
{
"second": 1796228318,
"success": 1702,
"errors": 0,
"p50_ms": 14.831,
"p95_ms": 42.315,
"p99_ms": 58.804
},
{
"second": 1796228319,
"success": 1894,
"errors": 0,
"p50_ms": 15.721,
"p95_ms": 30.961,
"p99_ms": 39.567
},
{
"second": 1796228320,
"success": 2164,
"errors": 0,
"p50_ms": 12.771,
"p95_ms": 31.823,
"p99_ms": 36.879
},
{
"second": 1796228321,
"success": 2147,
"errors": 0,
"p50_ms": 12.732,
"p95_ms": 31.282,
"p99_ms": 43.189
},
{
"second": 1796228322,
"success": 1820,
"errors": 0,
"p50_ms": 15.15,
"p95_ms": 34.903,
"p99_ms": 45.642
},
{
"second": 1796228323,
"success": 1882,
"errors": 0,
"p50_ms": 14.195,
"p95_ms": 37.173,
"p99_ms": 47.923
},
{
"second": 1796228324,
"success": 1714,
"errors": 0,
"p50_ms": 16.469,
"p95_ms": 34.877,
"p99_ms": 58.354
},
{
"second": 1796228325,
"success": 2069,
"errors": 0,
"p50_ms": 13.339,
"p95_ms": 34.026,
"p99_ms": 42.303
},
{
"second": 1796228326,
"success": 2301,
"errors": 0,
"p50_ms": 11.609,
"p95_ms": 31.6,
"p99_ms": 37.038
},
{
"second": 1796228327,
"success": 1874,
"errors": 0,
"p50_ms": 14.549,
"p95_ms": 35.41,
"p99_ms": 42.091
},
{
"second": 1796228328,
"success": 1654,
"errors": 0,
"p50_ms": 15.756,
"p95_ms": 41.998,
"p99_ms": 68.256
},
{
"second": 1796228329,
"success": 2217,
"errors": 0,
"p50_ms": 12.175,
"p95_ms": 33.021,
"p99_ms": 41.152
},
{
"second": 1796228330,
"success": 2185,
"errors": 0,
"p50_ms": 12.329,
"p95_ms": 32.085,
"p99_ms": 41.502
},
{
"second": 1796228331,
"success": 2178,
"errors": 0,
"p50_ms": 12.809,
"p95_ms": 32.729,
"p99_ms": 42.706
},
{
"second": 1796228332,
"success": 1458,
"errors": 0,
"p50_ms": 14.276,
"p95_ms": 36.888,
"p99_ms": 47.526
}
],
"uncertain_retries": 0,
"note": "track1 improve-optimized-rep1; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:19:56.199841Z",
"finished_at": "2026-12-02T16:20:16.203789Z",
"measured_seconds": 20.004,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 48355,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 2417.238,
"offered_rps": 2417.238,
"successful_latency_ms": {
"p50": 10.959,
"p95": 30.189,
"p99": 39.181,
"max": 81.772,
"mean": 13.226
},
"status_counts": {
"201": 48355
},
"instances": {
"179753b18445": 12088,
"7e7ded352ccc": 12089,
"b3c3ba230dc8": 12089,
"e5c81c09e4b7": 12089
},
"app_versions": {
"1.0.0": 48355
},
"kinds": {
"write": 48355
},
"series": [
{
"second": 1796228396,
"success": 1682,
"errors": 0,
"p50_ms": 12.636,
"p95_ms": 35.537,
"p99_ms": 42.946
},
{
"second": 1796228397,
"success": 2078,
"errors": 0,
"p50_ms": 13.233,
"p95_ms": 31.881,
"p99_ms": 41.124
},
{
"second": 1796228398,
"success": 2459,
"errors": 0,
"p50_ms": 10.576,
"p95_ms": 31.208,
"p99_ms": 44.039
},
{
"second": 1796228399,
"success": 1965,
"errors": 0,
"p50_ms": 13.58,
"p95_ms": 36.077,
"p99_ms": 44.107
},
{
"second": 1796228400,
"success": 2130,
"errors": 0,
"p50_ms": 13.129,
"p95_ms": 30.804,
"p99_ms": 37.56
},
{
"second": 1796228401,
"success": 2226,
"errors": 0,
"p50_ms": 11.52,
"p95_ms": 32.688,
"p99_ms": 45.979
},
{
"second": 1796228402,
"success": 2379,
"errors": 0,
"p50_ms": 10.964,
"p95_ms": 31.169,
"p99_ms": 38.946
},
{
"second": 1796228403,
"success": 2599,
"errors": 0,
"p50_ms": 10.753,
"p95_ms": 26.646,
"p99_ms": 32.294
},
{
"second": 1796228404,
"success": 2025,
"errors": 0,
"p50_ms": 12.636,
"p95_ms": 35.71,
"p99_ms": 45.96
},
{
"second": 1796228405,
"success": 2407,
"errors": 0,
"p50_ms": 10.656,
"p95_ms": 33.021,
"p99_ms": 42.701
},
{
"second": 1796228406,
"success": 2412,
"errors": 0,
"p50_ms": 11.395,
"p95_ms": 29.199,
"p99_ms": 37.704
},
{
"second": 1796228407,
"success": 2448,
"errors": 0,
"p50_ms": 11.033,
"p95_ms": 28.393,
"p99_ms": 36.469
},
{
"second": 1796228408,
"success": 2701,
"errors": 0,
"p50_ms": 9.6,
"p95_ms": 29.548,
"p99_ms": 35.283
},
{
"second": 1796228409,
"success": 2609,
"errors": 0,
"p50_ms": 10.315,
"p95_ms": 29.563,
"p99_ms": 35.589
},
{
"second": 1796228410,
"success": 2603,
"errors": 0,
"p50_ms": 10.608,
"p95_ms": 27.218,
"p99_ms": 33.233
},
{
"second": 1796228411,
"success": 2527,
"errors": 0,
"p50_ms": 10.562,
"p95_ms": 28.931,
"p99_ms": 38.116
},
{
"second": 1796228412,
"success": 2579,
"errors": 0,
"p50_ms": 10.435,
"p95_ms": 27.666,
"p99_ms": 36.746
},
{
"second": 1796228413,
"success": 2684,
"errors": 0,
"p50_ms": 9.784,
"p95_ms": 29.599,
"p99_ms": 35.498
},
{
"second": 1796228414,
"success": 2580,
"errors": 0,
"p50_ms": 10.371,
"p95_ms": 29.778,
"p99_ms": 39.026
},
{
"second": 1796228415,
"success": 2684,
"errors": 0,
"p50_ms": 10.318,
"p95_ms": 26.108,
"p99_ms": 34.054
},
{
"second": 1796228416,
"success": 578,
"errors": 0,
"p50_ms": 9.25,
"p95_ms": 27.295,
"p99_ms": 31.808
}
],
"uncertain_retries": 0,
"note": "track1 improve-optimized-rep2; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
@@ -0,0 +1,212 @@
{
"tool": "mtusi-lab3-loadgen",
"version": "dev",
"started_at": "2026-12-02T16:21:18.848745Z",
"finished_at": "2026-12-02T16:21:38.854058Z",
"measured_seconds": 20.006,
"warmup_seconds": 5,
"concurrency": 32,
"rate_limit_per_second": 0,
"read_ratio": 0,
"retry_uncertain": false,
"profile": "closed-loop",
"successful_requests": 47916,
"failed_requests": 0,
"error_ratio": 0,
"successful_rps": 2395.129,
"offered_rps": 2395.129,
"successful_latency_ms": {
"p50": 11.108,
"p95": 30.931,
"p99": 39.161,
"max": 85.332,
"mean": 13.348
},
"status_counts": {
"201": 47916
},
"instances": {
"39b20f50ef7e": 11979,
"acd665dfb78e": 11979,
"c9bd7561ad2b": 11979,
"d563f34357f8": 11979
},
"app_versions": {
"1.0.0": 47916
},
"kinds": {
"write": 47916
},
"series": [
{
"second": 1796228478,
"success": 293,
"errors": 0,
"p50_ms": 13.336,
"p95_ms": 33.871,
"p99_ms": 36.792
},
{
"second": 1796228479,
"success": 1729,
"errors": 0,
"p50_ms": 15.762,
"p95_ms": 40.494,
"p99_ms": 48.493
},
{
"second": 1796228480,
"success": 2386,
"errors": 0,
"p50_ms": 11.089,
"p95_ms": 31.36,
"p99_ms": 37.3
},
{
"second": 1796228481,
"success": 2279,
"errors": 0,
"p50_ms": 11.347,
"p95_ms": 33.14,
"p99_ms": 44.043
},
{
"second": 1796228482,
"success": 2455,
"errors": 0,
"p50_ms": 11.085,
"p95_ms": 29.55,
"p99_ms": 38.439
},
{
"second": 1796228483,
"success": 2590,
"errors": 0,
"p50_ms": 10.639,
"p95_ms": 29.391,
"p99_ms": 36.36
},
{
"second": 1796228484,
"success": 2647,
"errors": 0,
"p50_ms": 10.311,
"p95_ms": 27.256,
"p99_ms": 33.108
},
{
"second": 1796228485,
"success": 2400,
"errors": 0,
"p50_ms": 10.8,
"p95_ms": 31.082,
"p99_ms": 38.272
},
{
"second": 1796228486,
"success": 2516,
"errors": 0,
"p50_ms": 11.079,
"p95_ms": 26.528,
"p99_ms": 35.294
},
{
"second": 1796228487,
"success": 2423,
"errors": 0,
"p50_ms": 10.858,
"p95_ms": 31.821,
"p99_ms": 39.243
},
{
"second": 1796228488,
"success": 2509,
"errors": 0,
"p50_ms": 10.652,
"p95_ms": 31.056,
"p99_ms": 36.98
},
{
"second": 1796228489,
"success": 2386,
"errors": 0,
"p50_ms": 11.633,
"p95_ms": 30.021,
"p99_ms": 36.103
},
{
"second": 1796228490,
"success": 1808,
"errors": 0,
"p50_ms": 14.884,
"p95_ms": 36.751,
"p99_ms": 48.12
},
{
"second": 1796228491,
"success": 2226,
"errors": 0,
"p50_ms": 11.635,
"p95_ms": 33.723,
"p99_ms": 49.316
},
{
"second": 1796228492,
"success": 2632,
"errors": 0,
"p50_ms": 10.463,
"p95_ms": 25.659,
"p99_ms": 32.386
},
{
"second": 1796228493,
"success": 2526,
"errors": 0,
"p50_ms": 10.613,
"p95_ms": 29.147,
"p99_ms": 39.976
},
{
"second": 1796228494,
"success": 2485,
"errors": 0,
"p50_ms": 10.602,
"p95_ms": 31.617,
"p99_ms": 37.108
},
{
"second": 1796228495,
"success": 2431,
"errors": 0,
"p50_ms": 10.641,
"p95_ms": 31.986,
"p99_ms": 44.512
},
{
"second": 1796228496,
"success": 2584,
"errors": 0,
"p50_ms": 10.298,
"p95_ms": 28.174,
"p99_ms": 34.68
},
{
"second": 1796228497,
"success": 2569,
"errors": 0,
"p50_ms": 10.605,
"p95_ms": 29.429,
"p99_ms": 36.73
},
{
"second": 1796228498,
"success": 2042,
"errors": 0,
"p50_ms": 11.764,
"p95_ms": 26.96,
"p99_ms": 35.483
}
],
"uncertain_retries": 0,
"note": "track1 improve-optimized-rep3; replicas=4 cpu_per=0.2 mem_per=128M; synthetic messages created by loadgen, no retries unless -retry-uncertain"
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More