From 05248a98cecfbc856e1f4c019ac3bb7d46fe8757 Mon Sep 17 00:00:00 2001 From: dizi Date: Fri, 2 Oct 2026 14:39:37 +0300 Subject: [PATCH] docs: document lab3 verification --- REPORT.md | 190 ++- evidence/lab3-rolling-update.json | 29 + evidence/lab3-scale-results.json | 2048 +++++++++++++++++++++++++++++ evidence/lab3-scale-rps.svg | 1 + evidence/lab3-verification.txt | 50 + 5 files changed, 2303 insertions(+), 15 deletions(-) create mode 100644 evidence/lab3-rolling-update.json create mode 100644 evidence/lab3-scale-results.json create mode 100644 evidence/lab3-scale-rps.svg create mode 100644 evidence/lab3-verification.txt diff --git a/REPORT.md b/REPORT.md index c267900..22f7384 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,37 +1,197 @@ # Отчёт — лабораторная 3 -- Автор, группа: TODO -- Целевая оценка; выбранный трек 5, если нужен: TODO -- Commit/PR: TODO после публикации -- Использованные источники, библиотеки и помощь ИИ: TODO +- Автор, группа: Пластинин Денис, БВТ2303 +- Целевая оценка: 5 +- Выбранный трек: 1 — цена масштабирования +- Ветка/PR: `solution/bvt2303-plastinin`, PR #1 +- Среда эксперимента: Docker, `linux/arm64`, Go 1.26.5 ## Запуск из чистого clone -TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных. +Требуются Git, Docker Engine с Docker Compose v2 и свободные локальные порты 8080, 8081, 9090 и 3000. Все внешние образы закреплены по версиям. Локальные пароли из примера предназначены только для изолированного стенда. Compose передаёт каждому контейнеру только нужные ему переменные: API получает строки подключения PostgreSQL/Valkey без отдельных исходных паролей и пароля Grafana, а `migrate` — только настройки PostgreSQL и миграций. + +```sh +cp lab3.env.example .env +docker compose --env-file .env config --quiet +docker compose --env-file .env up -d --build --scale api=2 --wait --wait-timeout 120 +``` + +Compose сначала ожидает PostgreSQL, затем однократно запускает контейнер `migrate`. API-реплики стартуют только после успешного завершения миграций. Единственная публичная точка API — Nginx на `http://localhost:8080`; порты отдельных API-контейнеров на хост не публикуются. + +Доступные интерфейсы: + +- Swagger UI: `http://localhost:8081`; +- Prometheus: `http://localhost:9090`; +- Grafana: `http://localhost:3000`, логин `admin`, локальный пароль берётся из `.env`; +- Nginx API: `http://localhost:8080`. + +Проверки запущенного стенда: + +```sh +make check +make test +docker compose --profile tests run --rm --build tests +make test-persistence ACTION_SCRIPT=scripts/restart.sh +make test-failover ACTION_SCRIPT=scripts/stop-one.sh +``` + +Безопасная остановка сохраняет данные в named volumes: + +```sh +docker compose stop +``` + +Повторный запуск выполняется командой `docker compose up -d --scale api=2 --wait`. Намеренное удаление всех учебных данных: + +```sh +docker compose down -v +``` ## Архитектура и решения -TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab2, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации. +```mermaid +flowchart LR + C[Клиент] -->|HTTP :8080| N[Nginx] + N --> A1[API replica 1] + N --> A2[API replica 2] + N -. scale .-> AN[API replica N] + A1 --> P[(PostgreSQL)] + A2 --> P + AN --> P + A1 --> V[(Valkey)] + A2 --> V + AN --> V + M[Однократный migrate] --> P + PR[Prometheus] --> A1 + PR --> A2 + PR --> NE[Nginx exporter] + PR --> PE[PostgreSQL exporter] + PR --> VE[Valkey exporter] + G[Grafana] --> PR +``` + +PostgreSQL является источником истины для пользователей, чатов, сообщений и записей идемпотентности. Valkey хранит общие сессии, поэтому запросы с одним bearer token могут обслуживаться разными API-репликами. В Valkey ключ имеет вид `session:`, а значением служит JSON с `user_id` и сроком действия. Исходный случайный 256-битный токен возвращается клиенту один раз и не записывается в хранилище. + +API остаётся stateless относительно пользовательских данных. Локально в процессе находятся только конфигурация, подключения, метрики конкретной реплики и флаг readiness. Каждый HTTP-ответ содержит `X-Instance-Id`, равный hostname контейнера. + +### Балансировка и отказ реплики + +Nginx OSS 1.30.5 использует round-robin, Docker DNS `127.0.0.11`, повторное разрешение имени `api` каждые 2 секунды и общий upstream zone. Keep-alive соединения ограничены 32. Таймаут подключения равен 1 секунде, таймауты отправки и чтения — 10 секунд. Ошибка соединения или ответ 502/503/504 временно исключают backend на 3 секунды; небезопасные POST автоматически не повторяются. + +Docker проверяет `/health/ready` каждой API-реплики раз в 2 секунды с таймаутом 1 секунду. Readiness обращается к PostgreSQL и Valkey. При SIGTERM приложение сначала снимает readiness, затем вызывает `http.Server.Shutdown` с лимитом 5 секунд; Compose даёт контейнеру 8 секунд до принудительной остановки. + +Nginx OSS в этом стенде использует пассивное исключение backend. Docker healthcheck не передаёт своё состояние напрямую в Nginx. Поэтому верхняя практическая граница обнаружения отказа складывается из connect timeout и fail timeout; в проверках восстановление произошло примерно за 1.4 секунды, что ниже требуемых 10 секунд. + +### Общая идемпотентность + +Для `POST /api/v1/chats/{chat_id}/messages` обязателен один заголовок `Idempotency-Key` длиной до 128 символов. Область ключа — `(user_id, chat_id, key)`, поэтому одинаковая строка независима для другого пользователя или чата. Минимальный TTL равен 24 часам. + +Запись сообщения и запись идемпотентности создаются в одной транзакции PostgreSQL: + +1. Проверяется участие пользователя в чате. +2. Из текста считается SHA-256 для выявления повторного использования ключа с другим запросом. +3. Строка идемпотентности блокируется через `SELECT ... FOR UPDATE`; конкурентные вставки разрешаются первичным ключом и `ON CONFLICT DO NOTHING`. +4. Победившая транзакция резервирует UUID сообщения и вставляет сообщение. Отложенный внешний ключ проверяется при commit. +5. Повтор с тем же телом читает исходное сообщение и возвращает тот же объект. Повтор с другим телом получает `409 Conflict`. + +Это позволяет безопасно повторить POST после timeout: подтверждённая ранее запись не дублируется, даже если повтор попал на другую реплику. Истёкшая запись заменяется при следующем использовании ключа. Фоновая очистка не реализована; для длительной эксплуатации нужен периодический job по индексу `expires_at`. + +### Миграции, обновление и развёртывание + +API не выполняет DDL при старте. Отдельная команда `/app/migrate` берёт advisory lock и применяет versioned SQL один раз. Миграция идемпотентности только добавляет таблицу и индекс, поэтому совместима с уже работающей предыдущей версией. + +`scripts/rolling-update.sh` собирает образы, запускает миграции, временно увеличивает число API с двух до трёх и поочерёдно заменяет старые контейнеры. Скрипт ждёт health каждого состава и затем возвращает две реплики. Workflow deploy запускается только вручную из `main` через `workflow_dispatch`; перед подключением к серверу он повторяет check, formatting, Go tests и build для SHA запуска. На сервере выполняется reset именно на этот SHA, даже если `main` успел измениться. Для SSH используются environment secrets `DEPLOY_HOST`, `DEPLOY_USER`, `DEPLOY_SSH_KEY` и заранее проверенный `DEPLOY_KNOWN_HOSTS`; изменяемых actions для SSH нет. + +## Наблюдаемость + +HTTP middleware каждой реплики публикует число запросов по route/status class, histogram latency, in-flight gauge, число replay идемпотентности, Go runtime и process metrics. Prometheus использует DNS service discovery имени `api` с периодом обновления 2 секунды и отдельно опрашивает Nginx, PostgreSQL и Valkey exporters каждые 5 секунд. Данные хранятся в Prometheus TSDB с retention 7 суток в named volume. + +Provisioned dashboard Grafana показывает общий RPS, RPS и p95 по репликам, классы HTTP-ответов, число healthy replicas, in-flight, heap, replay rate, активные соединения и запросы Nginx, соединения PostgreSQL и состояние Valkey. ## Доказательства критериев | Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства | | --- | --- | --- | --- | -| Публичный smoke | make test | TODO | TODO | -| Остальные пункты уровня 3 | TODO | TODO | TODO | -| Все пункты уровня 4, если заявлен | TODO | TODO | TODO | -| Выбранный трек 5, если заявлен | TODO | TODO | TODO | - -TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены. +| Публичный smoke | `make test` через Nginx | PASS: регистрация, сессия, чат, пагинация, доступ и идемпотентность | `evidence/lab3-verification.txt` | +| Общие сессии и ≥2 реплики | `make test-failover ACTION_SCRIPT=scripts/stop-one.sh` | Одна сессия обслужена двумя instance ID | `evidence/lab3-verification.txt` | +| Конкурентная идемпотентность | `docker compose --profile tests run --rm --build tests` | 8 конкурентных запросов через два Store вернули один message ID; в БД одна строка | `evidence/lab3-verification.txt` | +| Сохранность | `make test-persistence ACTION_SCRIPT=scripts/restart.sh` | API, PostgreSQL и Valkey перезапущены; старые данные и token доступны | `evidence/lab3-verification.txt` | +| Отказ API | Два запуска failover с остановкой разных реплик | 125–131 успешная запись; 0–1 переходная ошибка; восстановление 1.35–1.44 с; дублей нет | `evidence/lab3-verification.txt` | +| Rolling update | 60 секунд Go-нагрузки и `scripts/rolling-update.sh` | 134894 подтверждения, 2248.16 RPS, 0 ошибок, p95 13.12 ms | `evidence/lab3-rolling-update.json` | +| CPU/RAM-лимиты | `docker compose config` и scale experiment | Лимиты заданы всем сервисам; при 128 MiB API не хватает памяти для Argon2id, поэтому рабочий минимум эксперимента — 256 MiB | `evidence/lab3-verification.txt` | +| Трек 1 | `scripts/run-scale-experiment.sh` | 1/2/4 реплики, два бюджета, concurrency 8/32/64, три повтора | `evidence/lab3-scale-results.json`, `evidence/lab3-scale-rps.svg` | ## Эксперименты и отказы -TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения. +### Методика исследования масштабирования + +Гипотеза: при фиксированном суммарном бюджете дробление ресурсов между большим числом процессов сначала улучшит распределение конкурентных запросов, но затем проиграет из-за меньших CPU-квот и пулов каждой реплики. При добавлении одинаковых ресурсов на реплику RPS должен расти до насыщения PostgreSQL или Nginx. + +Используется Go-клиент `cmd/lab3experiment`. Он создаёт отдельного пользователя, сессию и чат, прогревает стенд 2 секунды, затем 6 секунд выполняет closed-loop POST сообщений через Nginx. Для каждого запроса генерируется уникальный idempotency key. Считаются только HTTP-подтверждения; автоматических retry измеряемого трафика нет. Для каждой точки используются concurrency 8, 32 и 64 и три изолированных повтора с новой базой. + +CPU и Nginx RPS считаются по разности монотонных `process_cpu_seconds_total` и `nginx_http_requests_total`, прочитанных непосредственно до и после измеряемого интервала. Поэтому bootstrap, warmup и простой между точками в них не входят. Resident memory и число healthy replicas снимаются после нагрузки с `/metrics` каждой реплики, соединения PostgreSQL — instant query к Prometheus. Короткая контрольная точка дала 2355.97 client RPS и 2359.64 RPS по Nginx-счётчику, расхождение 0.16%. + +Фиксированная серия имеет общий бюджет API 2 CPU и 1 GiB RAM: `1×(2 CPU, 1 GiB)`, `2×(1 CPU, 512 MiB)`, `4×(0.5 CPU, 256 MiB)`. Пулы PostgreSQL соответственно равны 16, 8 и 4 соединениям на реплику. В растущей серии каждая реплика получает 1 CPU, 256 MiB и пул 8, поэтому суммарный бюджет растёт вместе с числом процессов. + +Предварительный прогон с общим лимитом 512 MiB показал, что вариант `4×128 MiB` не выполняет регистрацию: базовое потребление процесса около 71 MiB, а Argon2id временно требует ещё 64 MiB. Cgroup завершает реплику, Nginx наблюдает premature upstream close. Этот результат определил минимальный рабочий лимит 256 MiB и не включён в сравнение throughput. + +Медианные результаты фиксированного суммарного бюджета: + +| Concurrency | 1 реплика: RPS / p95 ms | 2 реплики: RPS / p95 ms | 4 реплики: RPS / p95 ms | +| ---: | ---: | ---: | ---: | +| 8 | 2412 / 5.86 | 2484 / 5.59 | 2242 / 6.35 | +| 32 | 2731 / 18.63 | 2365 / 24.93 | 2013 / 34.58 | +| 64 | 2733 / 32.99 | 2198 / 55.06 | 2103 / 67.89 | + +При фиксированных 2 CPU и 1 GiB увеличение числа процессов не даёт линейного выигрыша. Две реплики дают небольшой выигрыш только при concurrency 8, одна быстрее при 32 и 64, а четыре проигрывают во всех профилях из-за квоты 0.5 CPU на процесс и расходов четырёх runtime. Для рабочего стенда две реплики остаются осознанным компромиссом ради отказоустойчивости, дальнейшее дробление бюджета не оправдано. + +Медианные результаты серии с 1 CPU и 256 MiB на каждую реплику: + +| Concurrency | 1 реплика: RPS / p95 ms | 2 реплики: RPS / p95 ms | 4 реплики: RPS / p95 ms | +| ---: | ---: | ---: | ---: | +| 8 | 2712 / 4.95 | 2554 / 5.28 | 2185 / 7.05 | +| 32 | 2818 / 15.34 | 2471 / 21.94 | 2130 / 24.14 | +| 64 | 2044 / 61.44 | 2239 / 57.76 | 1859 / 67.42 | + +Даже при росте суммарного CPU практический предел не превышает двух реплик. При concurrency 64 переход `1→2` повышает медианный RPS на 9.6%, а `2→4` снижает его на 17.0%. Одновременно число соединений PostgreSQL растёт `9→17→33`, суммарная resident memory — примерно `36→65→397 MiB`, а p95 у четырёх реплик достигает 67.42 ms. Точная средняя загрузка API составляет примерно `0.43→0.52→0.54 core` при доступных `1→2→4 core`. API не упирается в CPU-квоту. Вместе с ростом DB connections и tail latency это указывает на насыщение общего пути PostgreSQL/Nginx/network и расходы дополнительных процессов, но данный эксперимент не разделяет вклад этих компонентов. + +Во всех 54 основных точках было 0 HTTP-ошибок; каждая конфигурация наблюдала все заявленные реплики. Диапазоны трёх повторов заметно пересекаются и доступны в raw JSON, поэтому небольшие отличия нельзя считать точной оценкой абсолютной производительности. + +Для настройки пула конфигурация `4×0.5 CPU, 256 MiB` при concurrency 64 дополнительно сравнивалась с 10 и 4 соединениями PostgreSQL на реплику: + +| Пул на реплику | Median RPS | p50 / p95 / p99, ms | Соединения PostgreSQL | Ошибки | +| ---: | ---: | ---: | ---: | ---: | +| 10 | 1918 | 30.00 / 59.52 / 101.70 | 41 | 0 | +| 4 | 2179 | 23.61 / 66.76 / 80.91 | 17 | 0 | + +Уменьшение пула `10→4` сократило число соединений на 58.5%, повысило медианный RPS на 13.6%, уменьшило p50 на 21.3% и p99 на 20.4%. p95 вырос на 12.2%, то есть распределение задержек изменилось неравномерно. Для данного стенда выбран пул 4: он соответствует CPU-квоте 0.5 core и заметно снижает давление на общую БД. При строгом SLO на tail latency значение следует подбирать повторно на более длинном open-loop тесте. + +Итоговый график находится в `evidence/lab3-scale-rps.svg`, обезличенные исходные точки, медианы и диапазоны — в `evidence/lab3-scale-results.json`. + +### Отказ и обновление | Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных | | --- | --- | --- | --- | -| TODO | TODO | TODO | TODO | +| SIGTERM одной API-реплики | Nginx исключает backend, другая реплика продолжает работу | 0–1 переходная ошибка, старый instance ID исчез из последующих ответов | 1.35–1.44 с; подтверждённые сообщения сохранены, дублей нет | +| Полный restart API, PostgreSQL и Valkey без удаления volumes | Данные и сессия сохраняются | Старый bearer token и созданные сущности доступны после запуска | В пределах 90-секундного окна теста; потерь не обнаружено | +| Rolling update API 2→3→2 | Во время замены остаются healthy backend | 134894 успешных POST, 0 ошибок; наблюдались старые и новые instance ID | Перерыва по подтверждённым ответам не зафиксировано | +| Остановка PostgreSQL или Valkey | Readiness становится отрицательной | Все API теряют готовность, потому что хранилища общие | Автоматический failover хранилищ не реализован | ## Ограничения и следующие шаги -TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза. +- Все компоненты работают на одном Docker-хосте. Отказ хоста, Nginx, PostgreSQL или Valkey останавливает сервис; выполнен отказ процесса API, а не отказ узла. +- Nginx является одной публичной точкой и SPOF. Для эксплуатации потребуются несколько LB с внешним virtual IP или управляемый балансировщик. +- PostgreSQL и Valkey не реплицированы. AOF Valkey с `appendfsync everysec` ограничивает возможную потерю примерно последней секундой при аварии хранилища, но этот сценарий в работе не заявляется как защищённый. +- Нагрузочный клиент closed-loop и подвержен coordinated omission. Результаты сравнивают конфигурации на одной машине и не являются абсолютной производительностью production-системы. +- Все реплики и клиент делят ресурсы одного хоста; дельта process CPU показывает потребление API, а не полную стоимость Docker/network/storage. +- Для эксплуатации нужны TLS, внешнее управление secrets, репликация хранилищ, алерты, план очистки истёкших idempotency records и длительный soak test. + +## Источники и инструменты + +- Nginx upstream и динамическое DNS: +- Docker Compose services и healthcheck: +- PostgreSQL explicit locking: +- Valkey persistence: +- Argon2: RFC 9106, +- Go packages: `pgx/v5`, `valkey-go`, `prometheus/client_golang`, `google/uuid`, `viper`, `x/crypto/argon2`. +- OpenAI Codex использовался для подготовки кода, конфигурации и текста; реализация и результаты проверены запуском тестов и экспериментов. diff --git a/evidence/lab3-rolling-update.json b/evidence/lab3-rolling-update.json new file mode 100644 index 0000000..b85d4df --- /dev/null +++ b/evidence/lab3-rolling-update.json @@ -0,0 +1,29 @@ +{ + "label": "rolling-update", + "timestamp": "2026-10-02T09:54:15Z", + "goos": "linux", + "goarch": "arm64", + "duration_seconds": 60.001996238, + "warmup_seconds": 3, + "concurrency": 16, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 10, + "successful_requests": 134894, + "successful_rps": 2248.158535675018, + "errors": {}, + "latency_ms": { + "p50": 6.41, + "p95": 13.12, + "p99": 22.006 + }, + "observed_instances": 5, + "prometheus": { + "api_cpu_cores": 0.4491430158747135, + "api_resident_bytes": 58523648, + "healthy_replicas": 2, + "nginx_rps": 2253.547396138092, + "postgres_connections": 21 + } +} diff --git a/evidence/lab3-scale-results.json b/evidence/lab3-scale-results.json new file mode 100644 index 0000000..79054b9 --- /dev/null +++ b/evidence/lab3-scale-results.json @@ -0,0 +1,2048 @@ +{ + "generated_at": "2026-10-02T11:34:39Z", + "method": "closed-loop HTTP through Nginx; median of three isolated repeats", + "raw": [ + { + "label": "fixed-r1-c32-n1", + "timestamp": "2026-10-02T11:13:52Z", + "duration_seconds": 6.001228475, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 16389, + "successful_rps": 2730.940851239629, + "errors": {}, + "latency_ms": { + "p50": 10.785, + "p95": 18.628, + "p99": 34.675 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.42657932632701506, + "api_resident_bytes": 36622336, + "healthy_replicas": 1, + "nginx_rps": 2736.939623016103, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r1-c32-n2", + "timestamp": "2026-10-02T11:20:24Z", + "duration_seconds": 6.001659422, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 15981, + "successful_rps": 2662.7635585950115, + "errors": {}, + "latency_ms": { + "p50": 11.032, + "p95": 19.337, + "p99": 29.03 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.4198838725773999, + "api_resident_bytes": 33845248, + "healthy_replicas": 1, + "nginx_rps": 2668.9285202161873, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r1-c32-n3", + "timestamp": "2026-10-02T11:28:48Z", + "duration_seconds": 6.000657423, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 18345, + "successful_rps": 3057.1650248996393, + "errors": {}, + "latency_ms": { + "p50": 10.149, + "p95": 14.379, + "p99": 20.03 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.426619921708535, + "api_resident_bytes": 34050048, + "healthy_replicas": 1, + "nginx_rps": 3063.331015955583, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r1-c64-n1", + "timestamp": "2026-10-02T11:14:03Z", + "duration_seconds": 6.004250916, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 16412, + "successful_rps": 2733.3967599964303, + "errors": {}, + "latency_ms": { + "p50": 21.54, + "p95": 32.991, + "p99": 66.967 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.41970264655075573, + "api_resident_bytes": 35110912, + "healthy_replicas": 1, + "nginx_rps": 2744.555520837264, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r1-c64-n2", + "timestamp": "2026-10-02T11:20:35Z", + "duration_seconds": 6.002174937, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 17519, + "successful_rps": 2918.775307931349, + "errors": {}, + "latency_ms": { + "p50": 20.995, + "p95": 29.421, + "p99": 36.314 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.4281781232595221, + "api_resident_bytes": 35639296, + "healthy_replicas": 1, + "nginx_rps": 2930.2711408126356, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r1-c64-n3", + "timestamp": "2026-10-02T11:28:59Z", + "duration_seconds": 6.005813394, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 13572, + "successful_rps": 2259.810471893593, + "errors": {}, + "latency_ms": { + "p50": 25.128, + "p95": 47.38, + "p99": 80.951 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.422923563115954, + "api_resident_bytes": 35971072, + "healthy_replicas": 1, + "nginx_rps": 2271.2993403404435, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r1-c8-n1", + "timestamp": "2026-10-02T11:13:40Z", + "duration_seconds": 6.000388895, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 14474, + "successful_rps": 2412.1769860718337, + "errors": {}, + "latency_ms": { + "p50": 2.981, + "p95": 5.859, + "p99": 9.624 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.42497245505618175, + "api_resident_bytes": 30003200, + "healthy_replicas": 1, + "nginx_rps": 2414.1768564485683, + "postgres_connections": 10 + } + }, + { + "label": "fixed-r1-c8-n2", + "timestamp": "2026-10-02T11:20:12Z", + "duration_seconds": 6.000665371, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 9954, + "successful_rps": 1658.816045318185, + "errors": {}, + "latency_ms": { + "p50": 3.644, + "p95": 12.672, + "p99": 20.831 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.4366182478133057, + "api_resident_bytes": 30031872, + "healthy_replicas": 1, + "nginx_rps": 1660.8158235524445, + "postgres_connections": 10 + } + }, + { + "label": "fixed-r1-c8-n3", + "timestamp": "2026-10-02T11:28:37Z", + "duration_seconds": 6.000879206, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_requests": 17507, + "successful_rps": 2917.4058332145005, + "errors": {}, + "latency_ms": { + "p50": 2.655, + "p95": 4.172, + "p99": 5.742 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.42660415451128814, + "api_resident_bytes": 29147136, + "healthy_replicas": 1, + "nginx_rps": 2919.5721824366283, + "postgres_connections": 10 + } + }, + { + "label": "fixed-r2-c32-n1", + "timestamp": "2026-10-02T11:14:45Z", + "duration_seconds": 6.002851707, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 14197, + "successful_rps": 2365.0425985777233, + "errors": {}, + "latency_ms": { + "p50": 12.159, + "p95": 24.925, + "p99": 44.989 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.514755344763342, + "api_resident_bytes": 62197760, + "healthy_replicas": 2, + "nginx_rps": 2371.039748225451, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r2-c32-n2", + "timestamp": "2026-10-02T11:21:17Z", + "duration_seconds": 6.002198827, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 15653, + "successful_rps": 2607.877621378903, + "errors": {}, + "latency_ms": { + "p50": 11.861, + "p95": 20.571, + "p99": 43.978 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.49981683154262496, + "api_resident_bytes": 62091264, + "healthy_replicas": 2, + "nginx_rps": 2613.7088177469, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r2-c32-n3", + "timestamp": "2026-10-02T11:29:42Z", + "duration_seconds": 6.001806643, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 13823, + "successful_rps": 2303.139841421246, + "errors": {}, + "latency_ms": { + "p50": 12.392, + "p95": 26.935, + "p99": 49.468 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5165111414603097, + "api_resident_bytes": 62054400, + "healthy_replicas": 2, + "nginx_rps": 2309.3046518193205, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r2-c64-n1", + "timestamp": "2026-10-02T11:14:57Z", + "duration_seconds": 6.00093491, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 13188, + "successful_rps": 2197.657564661037, + "errors": {}, + "latency_ms": { + "p50": 28.424, + "p95": 55.062, + "p99": 78.884 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5149197660602521, + "api_resident_bytes": 65277952, + "healthy_replicas": 2, + "nginx_rps": 2209.155773029373, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r2-c64-n2", + "timestamp": "2026-10-02T11:21:29Z", + "duration_seconds": 6.001721202, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 15112, + "successful_rps": 2517.944351524378, + "errors": {}, + "latency_ms": { + "p50": 24.691, + "p95": 49.451, + "p99": 72.134 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5165184945556889, + "api_resident_bytes": 64376832, + "healthy_replicas": 2, + "nginx_rps": 2529.607672369184, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r2-c64-n3", + "timestamp": "2026-10-02T11:29:54Z", + "duration_seconds": 6.004428561, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 11522, + "successful_rps": 1918.9169931736324, + "errors": {}, + "latency_ms": { + "p50": 30.021, + "p95": 67.901, + "p99": 111.126 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5179510370395763, + "api_resident_bytes": 64458752, + "healthy_replicas": 2, + "nginx_rps": 1930.4085113587548, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r2-c8-n1", + "timestamp": "2026-10-02T11:14:34Z", + "duration_seconds": 6.001018858, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 14010, + "successful_rps": 2334.603561747381, + "errors": {}, + "latency_ms": { + "p50": 3.026, + "p95": 6.321, + "p99": 11.643 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.4949159584860614, + "api_resident_bytes": 59621376, + "healthy_replicas": 2, + "nginx_rps": 2336.6032221857085, + "postgres_connections": 16 + } + }, + { + "label": "fixed-r2-c8-n2", + "timestamp": "2026-10-02T11:21:06Z", + "duration_seconds": 6.000636999, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 15770, + "successful_rps": 2628.0543220041563, + "errors": {}, + "latency_ms": { + "p50": 2.814, + "p95": 5.05, + "p99": 7.998 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5032799018676317, + "api_resident_bytes": 58634240, + "healthy_replicas": 2, + "nginx_rps": 2630.2207586678246, + "postgres_connections": 14 + } + }, + { + "label": "fixed-r2-c8-n3", + "timestamp": "2026-10-02T11:29:31Z", + "duration_seconds": 6.000844108, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_requests": 14908, + "successful_rps": 2484.31716133493, + "errors": {}, + "latency_ms": { + "p50": 2.934, + "p95": 5.586, + "p99": 8.643 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.4949303708857487, + "api_resident_bytes": 58679296, + "healthy_replicas": 2, + "nginx_rps": 2486.3168800051753, + "postgres_connections": 15 + } + }, + { + "label": "fixed-r4-c32-n1", + "timestamp": "2026-10-02T11:15:41Z", + "duration_seconds": 6.0029428, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 12085, + "successful_rps": 2013.1792693410307, + "errors": {}, + "latency_ms": { + "p50": 12.487, + "p95": 34.58, + "p99": 68.218 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5613913229358108, + "api_resident_bytes": 369168384, + "healthy_replicas": 4, + "nginx_rps": 2019.1763279836684, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r4-c32-n2", + "timestamp": "2026-10-02T11:22:13Z", + "duration_seconds": 6.003303354, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 11491, + "successful_rps": 1914.112834618552, + "errors": {}, + "latency_ms": { + "p50": 13.572, + "p95": 34.597, + "p99": 69.614 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5763493523435897, + "api_resident_bytes": 474034176, + "healthy_replicas": 4, + "nginx_rps": 1920.2761080395671, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r4-c32-n3", + "timestamp": "2026-10-02T11:30:38Z", + "duration_seconds": 6.00495133, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 13473, + "successful_rps": 2243.64849265148, + "errors": {}, + "latency_ms": { + "p50": 12.734, + "p95": 27.775, + "p99": 41.779 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5795217660823239, + "api_resident_bytes": 374923264, + "healthy_replicas": 4, + "nginx_rps": 2249.6435454040557, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r4-c64-n1", + "timestamp": "2026-10-02T11:15:54Z", + "duration_seconds": 6.003245223, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 13699, + "successful_rps": 2281.9324367286467, + "errors": {}, + "latency_ms": { + "p50": 24.118, + "p95": 60.359, + "p99": 87.286 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5680261047700327, + "api_resident_bytes": 437239808, + "healthy_replicas": 4, + "nginx_rps": 2293.259643509985, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r4-c64-n2", + "timestamp": "2026-10-02T11:22:25Z", + "duration_seconds": 6.001440594, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 12619, + "successful_rps": 2102.6618196664267, + "errors": {}, + "latency_ms": { + "p50": 26.308, + "p95": 67.889, + "p99": 121.945 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5698631764212044, + "api_resident_bytes": 438214656, + "healthy_replicas": 4, + "nginx_rps": 2114.159059190714, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r4-c64-n3", + "timestamp": "2026-10-02T11:30:50Z", + "duration_seconds": 6.0011934, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 11940, + "successful_rps": 1989.6042677111523, + "errors": {}, + "latency_ms": { + "p50": 26.312, + "p95": 77.357, + "p99": 93.368 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5665539790802274, + "api_resident_bytes": 365211648, + "healthy_replicas": 4, + "nginx_rps": 2001.2686143392746, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r4-c8-n1", + "timestamp": "2026-10-02T11:15:29Z", + "duration_seconds": 6.000357282, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 13452, + "successful_rps": 2241.8665035753115, + "errors": {}, + "latency_ms": { + "p50": 3.164, + "p95": 6.348, + "p99": 9.942 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5682994928034352, + "api_resident_bytes": 615251968, + "healthy_replicas": 4, + "nginx_rps": 2244.0330412311605, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r4-c8-n2", + "timestamp": "2026-10-02T11:22:01Z", + "duration_seconds": 6.001054705, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 9964, + "successful_rps": 1660.3747990662587, + "errors": {}, + "latency_ms": { + "p50": 4.097, + "p95": 9.858, + "p99": 18.19 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5632343256567598, + "api_resident_bytes": 587333632, + "healthy_replicas": 4, + "nginx_rps": 1662.2078101852599, + "postgres_connections": 17 + } + }, + { + "label": "fixed-r4-c8-n3", + "timestamp": "2026-10-02T11:30:26Z", + "duration_seconds": 6.00084231, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 15560, + "successful_rps": 2592.9693193354383, + "errors": {}, + "latency_ms": { + "p50": 2.877, + "p95": 5.636, + "p99": 7.487 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5615878281594106, + "api_resident_bytes": 127115264, + "healthy_replicas": 4, + "nginx_rps": 2595.1356818772997, + "postgres_connections": 17 + } + }, + { + "label": "growing-r1-c32-n1", + "timestamp": "2026-10-02T11:16:36Z", + "duration_seconds": 6.003394308, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 17867, + "successful_rps": 2976.1496718932494, + "errors": {}, + "latency_ms": { + "p50": 10.134, + "p95": 14.455, + "p99": 21.076 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.42142825711590765, + "api_resident_bytes": 33411072, + "healthy_replicas": 1, + "nginx_rps": 2982.3128519380275, + "postgres_connections": 9 + } + }, + { + "label": "growing-r1-c32-n2", + "timestamp": "2026-10-02T11:23:08Z", + "duration_seconds": 6.001408915, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 13653, + "successful_rps": 2274.9657944279575, + "errors": {}, + "latency_ms": { + "p50": 11.761, + "p95": 23.312, + "p99": 55.308 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.4382304284293216, + "api_resident_bytes": 32964608, + "healthy_replicas": 1, + "nginx_rps": 2281.1310133830466, + "postgres_connections": 9 + } + }, + { + "label": "growing-r1-c32-n3", + "timestamp": "2026-10-02T11:31:33Z", + "duration_seconds": 6.001539678, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 16912, + "successful_rps": 2817.9435457195686, + "errors": {}, + "latency_ms": { + "p50": 10.857, + "p95": 15.335, + "p99": 21.528 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.4265572065422242, + "api_resident_bytes": 31309824, + "healthy_replicas": 1, + "nginx_rps": 2823.775382527763, + "postgres_connections": 9 + } + }, + { + "label": "growing-r1-c64-n1", + "timestamp": "2026-10-02T11:16:47Z", + "duration_seconds": 6.003172059, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 12270, + "successful_rps": 2043.9194278306127, + "errors": {}, + "latency_ms": { + "p50": 26.551, + "p95": 61.444, + "p99": 102.98 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.42644121721649303, + "api_resident_bytes": 34877440, + "healthy_replicas": 1, + "nginx_rps": 2055.5799298638763, + "postgres_connections": 9 + } + }, + { + "label": "growing-r1-c64-n2", + "timestamp": "2026-10-02T11:23:19Z", + "duration_seconds": 6.002412878, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 9446, + "successful_rps": 1573.7004754573632, + "errors": {}, + "latency_ms": { + "p50": 28.822, + "p95": 96.357, + "p99": 222.405 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.43315913997344313, + "api_resident_bytes": 36052992, + "healthy_replicas": 1, + "nginx_rps": 1585.362452302802, + "postgres_connections": 9 + } + }, + { + "label": "growing-r1-c64-n3", + "timestamp": "2026-10-02T11:31:45Z", + "duration_seconds": 6.003872011, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 15085, + "successful_rps": 2512.545232870055, + "errors": {}, + "latency_ms": { + "p50": 23.32, + "p95": 36.688, + "p99": 58.614 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.4263915012361512, + "api_resident_bytes": 35610624, + "healthy_replicas": 1, + "nginx_rps": 2523.87125712164, + "postgres_connections": 9 + } + }, + { + "label": "growing-r1-c8-n1", + "timestamp": "2026-10-02T11:16:25Z", + "duration_seconds": 6.000515988, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 15415, + "successful_rps": 2568.9457424707057, + "errors": {}, + "latency_ms": { + "p50": 2.94, + "p95": 5.009, + "p99": 7.398 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.42496345399288354, + "api_resident_bytes": 29818880, + "healthy_replicas": 1, + "nginx_rps": 2571.112222824395, + "postgres_connections": 9 + } + }, + { + "label": "growing-r1-c8-n2", + "timestamp": "2026-10-02T11:22:56Z", + "duration_seconds": 6.000646429, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 16486, + "successful_rps": 2747.370669987529, + "errors": {}, + "latency_ms": { + "p50": 2.63, + "p95": 4.946, + "p99": 9.012 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.41995475484463013, + "api_resident_bytes": 30105600, + "healthy_replicas": 1, + "nginx_rps": 2749.537103246648, + "postgres_connections": 9 + } + }, + { + "label": "growing-r1-c8-n3", + "timestamp": "2026-10-02T11:31:22Z", + "duration_seconds": 6.000635097, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 16276, + "successful_rps": 2712.3795626461506, + "errors": {}, + "latency_ms": { + "p50": 2.735, + "p95": 4.824, + "p99": 8.061 + }, + "observed_instances": 1, + "prometheus": { + "api_cpu_cores": 0.41662256737622116, + "api_resident_bytes": 30113792, + "healthy_replicas": 1, + "nginx_rps": 2714.545999996507, + "postgres_connections": 9 + } + }, + { + "label": "growing-r2-c32-n1", + "timestamp": "2026-10-02T11:17:29Z", + "duration_seconds": 6.00069083, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 15746, + "successful_rps": 2624.0312067535733, + "errors": {}, + "latency_ms": { + "p50": 11.67, + "p95": 21.115, + "p99": 31.725 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5066083366271347, + "api_resident_bytes": 62099456, + "healthy_replicas": 2, + "nginx_rps": 2630.030516003105, + "postgres_connections": 17 + } + }, + { + "label": "growing-r2-c32-n2", + "timestamp": "2026-10-02T11:24:02Z", + "duration_seconds": 6.002365388, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 14830, + "successful_rps": 2470.6926422120705, + "errors": {}, + "latency_ms": { + "p50": 11.857, + "p95": 21.935, + "p99": 34.466 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5031349817586277, + "api_resident_bytes": 62484480, + "healthy_replicas": 2, + "nginx_rps": 2476.85687874355, + "postgres_connections": 17 + } + }, + { + "label": "growing-r2-c32-n3", + "timestamp": "2026-10-02T11:32:27Z", + "duration_seconds": 6.003222172, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 14108, + "successful_rps": 2350.071277688505, + "errors": {}, + "latency_ms": { + "p50": 12.949, + "p95": 24.988, + "p99": 42.291 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5080604902856491, + "api_resident_bytes": 62377984, + "healthy_replicas": 2, + "nginx_rps": 2356.234634455904, + "postgres_connections": 17 + } + }, + { + "label": "growing-r2-c64-n1", + "timestamp": "2026-10-02T11:17:41Z", + "duration_seconds": 6.006687453, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 14149, + "successful_rps": 2355.541238113426, + "errors": {}, + "latency_ms": { + "p50": 24.56, + "p95": 57.759, + "p99": 83.657 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5194210660056459, + "api_resident_bytes": 64593920, + "healthy_replicas": 2, + "nginx_rps": 2366.861953654575, + "postgres_connections": 17 + } + }, + { + "label": "growing-r2-c64-n2", + "timestamp": "2026-10-02T11:24:13Z", + "duration_seconds": 6.014530011, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 12614, + "successful_rps": 2097.2544782269274, + "errors": {}, + "latency_ms": { + "p50": 28.563, + "p95": 57.99, + "p99": 89.912 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5104305730265314, + "api_resident_bytes": 65654784, + "healthy_replicas": 2, + "nginx_rps": 2108.5604322874497, + "postgres_connections": 17 + } + }, + { + "label": "growing-r2-c64-n3", + "timestamp": "2026-10-02T11:32:39Z", + "duration_seconds": 6.001685646, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 13439, + "successful_rps": 2239.2042490524, + "errors": {}, + "latency_ms": { + "p50": 28.242, + "p95": 55.31, + "p99": 82.937 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5198539517109522, + "api_resident_bytes": 64917504, + "healthy_replicas": 2, + "nginx_rps": 2250.7010191383156, + "postgres_connections": 17 + } + }, + { + "label": "growing-r2-c8-n1", + "timestamp": "2026-10-02T11:17:18Z", + "duration_seconds": 6.000737232, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 15448, + "successful_rps": 2574.3503510903274, + "errors": {}, + "latency_ms": { + "p50": 2.815, + "p95": 5.282, + "p99": 10.559 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5049379572633153, + "api_resident_bytes": 58855424, + "healthy_replicas": 2, + "nginx_rps": 2576.516751567035, + "postgres_connections": 15 + } + }, + { + "label": "growing-r2-c8-n2", + "timestamp": "2026-10-02T11:23:50Z", + "duration_seconds": 6.001116768, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 15263, + "successful_rps": 2543.3599428338935, + "errors": {}, + "latency_ms": { + "p50": 2.932, + "p95": 5.415, + "p99": 7.726 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5132378054070886, + "api_resident_bytes": 59572224, + "healthy_replicas": 2, + "nginx_rps": 2545.69284194938, + "postgres_connections": 14 + } + }, + { + "label": "growing-r2-c8-n3", + "timestamp": "2026-10-02T11:32:16Z", + "duration_seconds": 6.000150243, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 15324, + "successful_rps": 2553.9360481643857, + "errors": {}, + "latency_ms": { + "p50": 2.891, + "p95": 5.208, + "p99": 8.66 + }, + "observed_instances": 2, + "prometheus": { + "api_cpu_cores": 0.5149871044654106, + "api_resident_bytes": 58920960, + "healthy_replicas": 2, + "nginx_rps": 2555.93599808464, + "postgres_connections": 15 + } + }, + { + "label": "growing-r4-c32-n1", + "timestamp": "2026-10-02T11:18:24Z", + "duration_seconds": 6.001886675, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 14778, + "successful_rps": 2462.2257633679833, + "errors": {}, + "latency_ms": { + "p50": 12.519, + "p95": 20.369, + "p99": 27.493 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5364979671163151, + "api_resident_bytes": 423374848, + "healthy_replicas": 4, + "nginx_rps": 2468.390491561556, + "postgres_connections": 33 + } + }, + { + "label": "growing-r4-c32-n2", + "timestamp": "2026-10-02T11:24:57Z", + "duration_seconds": 6.003686343, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 10176, + "successful_rps": 1694.9586335176737, + "errors": {}, + "latency_ms": { + "p50": 16.525, + "p95": 33.496, + "p99": 66.101 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5496622927091513, + "api_resident_bytes": 492273664, + "healthy_replicas": 4, + "nginx_rps": 1701.2880781003853, + "postgres_connections": 33 + } + }, + { + "label": "growing-r4-c32-n3", + "timestamp": "2026-10-02T11:33:22Z", + "duration_seconds": 6.001351862, + "warmup_seconds": 2, + "concurrency": 32, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 12781, + "successful_rps": 2129.686826217956, + "errors": {}, + "latency_ms": { + "p50": 13.923, + "p95": 24.14, + "p99": 39.802 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5415446510608212, + "api_resident_bytes": 369414144, + "healthy_replicas": 4, + "nginx_rps": 2135.3522164136693, + "postgres_connections": 33 + } + }, + { + "label": "growing-r4-c64-n1", + "timestamp": "2026-10-02T11:18:36Z", + "duration_seconds": 6.006332231, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 11165, + "successful_rps": 1858.871532675962, + "errors": {}, + "latency_ms": { + "p50": 30.388, + "p95": 67.422, + "p99": 98.596 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5410956096011533, + "api_resident_bytes": 397496320, + "healthy_replicas": 4, + "nginx_rps": 1870.3594086951864, + "postgres_connections": 33 + } + }, + { + "label": "growing-r4-c64-n2", + "timestamp": "2026-10-02T11:25:09Z", + "duration_seconds": 6.040332097, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 10524, + "successful_rps": 1742.288309814433, + "errors": {}, + "latency_ms": { + "p50": 26.708, + "p95": 81.814, + "p99": 125.924 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5512941915319329, + "api_resident_bytes": 414949376, + "healthy_replicas": 4, + "nginx_rps": 1753.7115227921217, + "postgres_connections": 33 + } + }, + { + "label": "growing-r4-c64-n3", + "timestamp": "2026-10-02T11:33:34Z", + "duration_seconds": 6.006393765, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 13269, + "successful_rps": 2209.1458734057874, + "errors": {}, + "latency_ms": { + "p50": 24.93, + "p95": 59.356, + "p99": 84.385 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5410900662121342, + "api_resident_bytes": 376426496, + "healthy_replicas": 4, + "nginx_rps": 2220.6336317345986, + "postgres_connections": 33 + } + }, + { + "label": "growing-r4-c8-n1", + "timestamp": "2026-10-02T11:18:13Z", + "duration_seconds": 6.000820517, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 13215, + "successful_rps": 2202.198843068647, + "errors": {}, + "latency_ms": { + "p50": 3.125, + "p95": 7.049, + "p99": 13.356 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5615898676610925, + "api_resident_bytes": 614596608, + "healthy_replicas": 4, + "nginx_rps": 2204.365213478022, + "postgres_connections": 19 + } + }, + { + "label": "growing-r4-c8-n2", + "timestamp": "2026-10-02T11:24:45Z", + "duration_seconds": 6.000744805, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 12122, + "successful_rps": 2020.082572066652, + "errors": {}, + "latency_ms": { + "p50": 3.487, + "p95": 7.328, + "p99": 13.364 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5749286317134096, + "api_resident_bytes": 605945856, + "healthy_replicas": 4, + "nginx_rps": 2022.2489698093402, + "postgres_connections": 17 + } + }, + { + "label": "growing-r4-c8-n3", + "timestamp": "2026-10-02T11:33:10Z", + "duration_seconds": 6.000546553, + "warmup_seconds": 2, + "concurrency": 8, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_requests": 13110, + "successful_rps": 2184.8009817448374, + "errors": {}, + "latency_ms": { + "p50": 3.294, + "p95": 6.916, + "p99": 10.948 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.561615507893219, + "api_resident_bytes": 614023168, + "healthy_replicas": 4, + "nginx_rps": 2186.96745106312, + "postgres_connections": 19 + } + }, + { + "label": "pool-baseline-r4-c64-n1", + "timestamp": "2026-10-02T11:19:09Z", + "duration_seconds": 6.003512334, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 10, + "successful_requests": 12010, + "successful_rps": 2000.495598548728, + "errors": {}, + "latency_ms": { + "p50": 27.976, + "p95": 56.907, + "p99": 100.328 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5463468412356225, + "api_resident_bytes": 612368384, + "healthy_replicas": 4, + "nginx_rps": 2011.9888705137455, + "postgres_connections": 41 + } + }, + { + "label": "pool-baseline-r4-c64-n2", + "timestamp": "2026-10-02T11:25:42Z", + "duration_seconds": 6.006350196, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 10, + "successful_requests": 9128, + "successful_rps": 1519.7249081611826, + "errors": {}, + "latency_ms": { + "p50": 33.678, + "p95": 92.261, + "p99": 165.149 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5460887049483655, + "api_resident_bytes": 586547200, + "healthy_replicas": 4, + "nginx_rps": 1531.0462593613315, + "postgres_connections": 41 + } + }, + { + "label": "pool-baseline-r4-c64-n3", + "timestamp": "2026-10-02T11:34:06Z", + "duration_seconds": 6.002334631, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 10, + "successful_requests": 11511, + "successful_rps": 1917.7537920911027, + "errors": {}, + "latency_ms": { + "p50": 29.998, + "p95": 59.521, + "p99": 101.701 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5247957992430696, + "api_resident_bytes": 610664448, + "healthy_replicas": 4, + "nginx_rps": 1929.415920963171, + "postgres_connections": 41 + } + }, + { + "label": "pool-tuned-r4-c64-n1", + "timestamp": "2026-10-02T11:19:41Z", + "duration_seconds": 6.002401553, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 13059, + "successful_rps": 2175.6291852005656, + "errors": {}, + "latency_ms": { + "p50": 22.884, + "p95": 71.837, + "p99": 93.913 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.5681059439110139, + "api_resident_bytes": 441999360, + "healthy_replicas": 4, + "nginx_rps": 2187.124584065627, + "postgres_connections": 17 + } + }, + { + "label": "pool-tuned-r4-c64-n2", + "timestamp": "2026-10-02T11:28:06Z", + "duration_seconds": 6.002283087, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 13783, + "successful_rps": 2296.2928939242815, + "errors": {}, + "latency_ms": { + "p50": 23.605, + "p95": 66.761, + "p99": 80.909 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.564785091083459, + "api_resident_bytes": 566091776, + "healthy_replicas": 4, + "nginx_rps": 2307.955122943704, + "postgres_connections": 17 + } + }, + { + "label": "pool-tuned-r4-c64-n3", + "timestamp": "2026-10-02T11:34:38Z", + "duration_seconds": 6.00190551, + "warmup_seconds": 2, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_requests": 13078, + "successful_rps": 2178.974657000223, + "errors": {}, + "latency_ms": { + "p50": 26.267, + "p95": 63.481, + "p99": 75.128 + }, + "observed_instances": 4, + "prometheus": { + "api_cpu_cores": 0.56981903402208, + "api_resident_bytes": 536719360, + "healthy_replicas": 4, + "nginx_rps": 2190.3043921796097, + "postgres_connections": 17 + } + } + ], + "summary": [ + { + "label": "fixed-r1-c32", + "repeats": 3, + "concurrency": 32, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_rps_median": 2730.940851239629, + "successful_rps_min": 2662.7635585950115, + "successful_rps_max": 3057.1650248996393, + "latency_p50_median_ms": 10.785, + "latency_p95_median_ms": 18.628, + "latency_p99_median_ms": 29.03, + "total_errors": 0, + "observed_instances_min": 1, + "api_cpu_cores_median": 0.42657932632701506, + "api_resident_bytes_median": 34050048, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 1 + }, + { + "label": "fixed-r1-c64", + "repeats": 3, + "concurrency": 64, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_rps_median": 2733.3967599964303, + "successful_rps_min": 2259.810471893593, + "successful_rps_max": 2918.775307931349, + "latency_p50_median_ms": 21.54, + "latency_p95_median_ms": 32.991, + "latency_p99_median_ms": 66.967, + "total_errors": 0, + "observed_instances_min": 1, + "api_cpu_cores_median": 0.422923563115954, + "api_resident_bytes_median": 35639296, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 1 + }, + { + "label": "fixed-r1-c8", + "repeats": 3, + "concurrency": 8, + "replicas": 1, + "api_cpus_per_replica": "2", + "api_memory_per_replica": "1g", + "db_max_connections_per_replica": 16, + "successful_rps_median": 2412.1769860718337, + "successful_rps_min": 1658.816045318185, + "successful_rps_max": 2917.4058332145005, + "latency_p50_median_ms": 2.981, + "latency_p95_median_ms": 5.859, + "latency_p99_median_ms": 9.624, + "total_errors": 0, + "observed_instances_min": 1, + "api_cpu_cores_median": 0.42660415451128814, + "api_resident_bytes_median": 30003200, + "postgres_connections_median": 10, + "prometheus_healthy_replicas_min": 1 + }, + { + "label": "fixed-r2-c32", + "repeats": 3, + "concurrency": 32, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2365.0425985777233, + "successful_rps_min": 2303.139841421246, + "successful_rps_max": 2607.877621378903, + "latency_p50_median_ms": 12.159, + "latency_p95_median_ms": 24.925, + "latency_p99_median_ms": 44.989, + "total_errors": 0, + "observed_instances_min": 2, + "api_cpu_cores_median": 0.514755344763342, + "api_resident_bytes_median": 62091264, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 2 + }, + { + "label": "fixed-r2-c64", + "repeats": 3, + "concurrency": 64, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2197.657564661037, + "successful_rps_min": 1918.9169931736324, + "successful_rps_max": 2517.944351524378, + "latency_p50_median_ms": 28.424, + "latency_p95_median_ms": 55.062, + "latency_p99_median_ms": 78.884, + "total_errors": 0, + "observed_instances_min": 2, + "api_cpu_cores_median": 0.5165184945556889, + "api_resident_bytes_median": 64458752, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 2 + }, + { + "label": "fixed-r2-c8", + "repeats": 3, + "concurrency": 8, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "512m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2484.31716133493, + "successful_rps_min": 2334.603561747381, + "successful_rps_max": 2628.0543220041563, + "latency_p50_median_ms": 2.934, + "latency_p95_median_ms": 5.586, + "latency_p99_median_ms": 8.643, + "total_errors": 0, + "observed_instances_min": 2, + "api_cpu_cores_median": 0.4949303708857487, + "api_resident_bytes_median": 58679296, + "postgres_connections_median": 15, + "prometheus_healthy_replicas_min": 2 + }, + { + "label": "fixed-r4-c32", + "repeats": 3, + "concurrency": 32, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_rps_median": 2013.1792693410307, + "successful_rps_min": 1914.112834618552, + "successful_rps_max": 2243.64849265148, + "latency_p50_median_ms": 12.734, + "latency_p95_median_ms": 34.58, + "latency_p99_median_ms": 68.218, + "total_errors": 0, + "observed_instances_min": 4, + "api_cpu_cores_median": 0.5763493523435897, + "api_resident_bytes_median": 374923264, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 4 + }, + { + "label": "fixed-r4-c64", + "repeats": 3, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_rps_median": 2102.6618196664267, + "successful_rps_min": 1989.6042677111523, + "successful_rps_max": 2281.9324367286467, + "latency_p50_median_ms": 26.308, + "latency_p95_median_ms": 67.889, + "latency_p99_median_ms": 93.368, + "total_errors": 0, + "observed_instances_min": 4, + "api_cpu_cores_median": 0.5680261047700327, + "api_resident_bytes_median": 437239808, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 4 + }, + { + "label": "fixed-r4-c8", + "repeats": 3, + "concurrency": 8, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_rps_median": 2241.8665035753115, + "successful_rps_min": 1660.3747990662587, + "successful_rps_max": 2592.9693193354383, + "latency_p50_median_ms": 3.164, + "latency_p95_median_ms": 6.348, + "latency_p99_median_ms": 9.942, + "total_errors": 0, + "observed_instances_min": 4, + "api_cpu_cores_median": 0.5632343256567598, + "api_resident_bytes_median": 587333632, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 4 + }, + { + "label": "growing-r1-c32", + "repeats": 3, + "concurrency": 32, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2817.9435457195686, + "successful_rps_min": 2274.9657944279575, + "successful_rps_max": 2976.1496718932494, + "latency_p50_median_ms": 10.857, + "latency_p95_median_ms": 15.335, + "latency_p99_median_ms": 21.528, + "total_errors": 0, + "observed_instances_min": 1, + "api_cpu_cores_median": 0.4265572065422242, + "api_resident_bytes_median": 32964608, + "postgres_connections_median": 9, + "prometheus_healthy_replicas_min": 1 + }, + { + "label": "growing-r1-c64", + "repeats": 3, + "concurrency": 64, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2043.9194278306127, + "successful_rps_min": 1573.7004754573632, + "successful_rps_max": 2512.545232870055, + "latency_p50_median_ms": 26.551, + "latency_p95_median_ms": 61.444, + "latency_p99_median_ms": 102.98, + "total_errors": 0, + "observed_instances_min": 1, + "api_cpu_cores_median": 0.42644121721649303, + "api_resident_bytes_median": 35610624, + "postgres_connections_median": 9, + "prometheus_healthy_replicas_min": 1 + }, + { + "label": "growing-r1-c8", + "repeats": 3, + "concurrency": 8, + "replicas": 1, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2712.3795626461506, + "successful_rps_min": 2568.9457424707057, + "successful_rps_max": 2747.370669987529, + "latency_p50_median_ms": 2.735, + "latency_p95_median_ms": 4.946, + "latency_p99_median_ms": 8.061, + "total_errors": 0, + "observed_instances_min": 1, + "api_cpu_cores_median": 0.41995475484463013, + "api_resident_bytes_median": 30105600, + "postgres_connections_median": 9, + "prometheus_healthy_replicas_min": 1 + }, + { + "label": "growing-r2-c32", + "repeats": 3, + "concurrency": 32, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2470.6926422120705, + "successful_rps_min": 2350.071277688505, + "successful_rps_max": 2624.0312067535733, + "latency_p50_median_ms": 11.857, + "latency_p95_median_ms": 21.935, + "latency_p99_median_ms": 34.466, + "total_errors": 0, + "observed_instances_min": 2, + "api_cpu_cores_median": 0.5066083366271347, + "api_resident_bytes_median": 62377984, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 2 + }, + { + "label": "growing-r2-c64", + "repeats": 3, + "concurrency": 64, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2239.2042490524, + "successful_rps_min": 2097.2544782269274, + "successful_rps_max": 2355.541238113426, + "latency_p50_median_ms": 28.242, + "latency_p95_median_ms": 57.759, + "latency_p99_median_ms": 83.657, + "total_errors": 0, + "observed_instances_min": 2, + "api_cpu_cores_median": 0.5194210660056459, + "api_resident_bytes_median": 64917504, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 2 + }, + { + "label": "growing-r2-c8", + "repeats": 3, + "concurrency": 8, + "replicas": 2, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2553.9360481643857, + "successful_rps_min": 2543.3599428338935, + "successful_rps_max": 2574.3503510903274, + "latency_p50_median_ms": 2.891, + "latency_p95_median_ms": 5.282, + "latency_p99_median_ms": 8.66, + "total_errors": 0, + "observed_instances_min": 2, + "api_cpu_cores_median": 0.5132378054070886, + "api_resident_bytes_median": 58920960, + "postgres_connections_median": 15, + "prometheus_healthy_replicas_min": 2 + }, + { + "label": "growing-r4-c32", + "repeats": 3, + "concurrency": 32, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2129.686826217956, + "successful_rps_min": 1694.9586335176737, + "successful_rps_max": 2462.2257633679833, + "latency_p50_median_ms": 13.923, + "latency_p95_median_ms": 24.14, + "latency_p99_median_ms": 39.802, + "total_errors": 0, + "observed_instances_min": 4, + "api_cpu_cores_median": 0.5415446510608212, + "api_resident_bytes_median": 423374848, + "postgres_connections_median": 33, + "prometheus_healthy_replicas_min": 4 + }, + { + "label": "growing-r4-c64", + "repeats": 3, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 1858.871532675962, + "successful_rps_min": 1742.288309814433, + "successful_rps_max": 2209.1458734057874, + "latency_p50_median_ms": 26.708, + "latency_p95_median_ms": 67.422, + "latency_p99_median_ms": 98.596, + "total_errors": 0, + "observed_instances_min": 4, + "api_cpu_cores_median": 0.5410956096011533, + "api_resident_bytes_median": 397496320, + "postgres_connections_median": 33, + "prometheus_healthy_replicas_min": 4 + }, + { + "label": "growing-r4-c8", + "repeats": 3, + "concurrency": 8, + "replicas": 4, + "api_cpus_per_replica": "1", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 8, + "successful_rps_median": 2184.8009817448374, + "successful_rps_min": 2020.082572066652, + "successful_rps_max": 2202.198843068647, + "latency_p50_median_ms": 3.294, + "latency_p95_median_ms": 7.049, + "latency_p99_median_ms": 13.356, + "total_errors": 0, + "observed_instances_min": 4, + "api_cpu_cores_median": 0.561615507893219, + "api_resident_bytes_median": 614023168, + "postgres_connections_median": 19, + "prometheus_healthy_replicas_min": 4 + }, + { + "label": "pool-baseline-r4-c64", + "repeats": 3, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 10, + "successful_rps_median": 1917.7537920911027, + "successful_rps_min": 1519.7249081611826, + "successful_rps_max": 2000.495598548728, + "latency_p50_median_ms": 29.998, + "latency_p95_median_ms": 59.521, + "latency_p99_median_ms": 101.701, + "total_errors": 0, + "observed_instances_min": 4, + "api_cpu_cores_median": 0.5460887049483655, + "api_resident_bytes_median": 610664448, + "postgres_connections_median": 41, + "prometheus_healthy_replicas_min": 4 + }, + { + "label": "pool-tuned-r4-c64", + "repeats": 3, + "concurrency": 64, + "replicas": 4, + "api_cpus_per_replica": "0.5", + "api_memory_per_replica": "256m", + "db_max_connections_per_replica": 4, + "successful_rps_median": 2178.974657000223, + "successful_rps_min": 2175.6291852005656, + "successful_rps_max": 2296.2928939242815, + "latency_p50_median_ms": 23.605, + "latency_p95_median_ms": 66.761, + "latency_p99_median_ms": 80.909, + "total_errors": 0, + "observed_instances_min": 4, + "api_cpu_cores_median": 0.5681059439110139, + "api_resident_bytes_median": 536719360, + "postgres_connections_median": 17, + "prometheus_healthy_replicas_min": 4 + } + ] +} diff --git a/evidence/lab3-scale-rps.svg b/evidence/lab3-scale-rps.svg new file mode 100644 index 0000000..7124497 --- /dev/null +++ b/evidence/lab3-scale-rps.svg @@ -0,0 +1 @@ +Median successful RPS by replica count06201240186024803100124API replicasfixed, c=32fixed, c=64fixed, c=8growing, c=32growing, c=64growing, c=8 \ No newline at end of file diff --git a/evidence/lab3-verification.txt b/evidence/lab3-verification.txt new file mode 100644 index 0000000..0efd76d --- /dev/null +++ b/evidence/lab3-verification.txt @@ -0,0 +1,50 @@ +Lab 3 verification +Date: 2026-10-02 +Environment: Docker linux/arm64, Go 1.26.5 + +Contract and build +- make check: PASS +- docker compose --env-file .env config --quiet: PASS +- go test ./cmd/lab3experiment: PASS +- go test ./internal/messenger ./internal/model ./internal/password: PASS + +Integration +- docker compose --profile tests run --rm --build tests: PASS +- PostgreSQL concurrent idempotency: 8 calls through two Store instances, one message ID and one row +- PostgreSQL and Valkey stop/recovery: PASS +- persistence after restarting API, PostgreSQL and Valkey: PASS; the original session and data remained valid +- public smoke through Nginx: PASS + +API replica failover +- run 1: 2 instances observed, 131 successful writes, 0 transition errors, first recovered write after 1.353 s +- run 2: 2 instances observed, 125 successful writes, 1 transition error, first recovered write after 1.442 s +- confirmed messages remained readable and idempotent retries did not create duplicates + +Rolling update under Go load +- duration: 60.002 s +- concurrency: 16 +- successful requests: 134894 +- successful RPS: 2248.16 +- errors: 0 +- latency p50/p95/p99: 6.41/13.12/22.01 ms +- healthy API replicas after update: 2 + +Resource boundary +- 4 API replicas with 128 MiB each restarted while Argon2id processed registration +- idle process memory was about 71 MiB; Argon2id memory parameter was 64 MiB +- the fixed-budget experiment therefore uses 256 MiB per replica as its minimum + +Scale experiment +- command: DURATION=6s WARMUP=2s REPEATS=3 CONCURRENCIES='8 32 64' scripts/run-scale-experiment.sh +- configurations: fixed total API resources and growing per-replica resources, 1/2/4 replicas +- completed points: 60; HTTP errors: 0; every point observed all configured replicas +- CPU and Nginx RPS use counter deltas read immediately before and after measured load +- maximum difference between client RPS and Nginx counter RPS across 60 points: 0.75% +- reducing the pool from 10 to 4 connections per replica changed median RPS from 1918 to 2179 and PostgreSQL connections from 41 to 17 +- combined sanitized raw data and median aggregates: evidence/lab3-scale-results.json +- comparison chart: evidence/lab3-scale-rps.svg + +Configuration scope +- API receives only its application settings and PostgreSQL/Valkey connection URLs +- migrate receives only PostgreSQL pool, dependency and migration settings +- neither container receives the Grafana password or separate source passwords of unrelated services