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
- black-box replica idempotency: 16 concurrent calls through Nginx, at least two instance IDs, one message ID and one history item
- 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
