forked from mtusi2026/mtusi2026lab3
docs: document lab3 verification
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="560" viewBox="0 0 960 560"><rect width="100%" height="100%" fill="white"/><style>text{font-family:system-ui,sans-serif;fill:#202124}.axis{stroke:#5f6368;stroke-width:1}.grid{stroke:#dadce0;stroke-width:1}.line{fill:none;stroke-width:2.5}.point{stroke:white;stroke-width:1.5}</style><text x="85" y="25" font-size="18" font-weight="600">Median successful RPS by replica count</text><line class="grid" x1="85" y1="490" x2="720" y2="490"/><text x="75" y="494" text-anchor="end" font-size="12">0</text><line class="grid" x1="85" y1="401" x2="720" y2="401"/><text x="75" y="405" text-anchor="end" font-size="12">620</text><line class="grid" x1="85" y1="312" x2="720" y2="312"/><text x="75" y="316" text-anchor="end" font-size="12">1240</text><line class="grid" x1="85" y1="223" x2="720" y2="223"/><text x="75" y="227" text-anchor="end" font-size="12">1860</text><line class="grid" x1="85" y1="134" x2="720" y2="134"/><text x="75" y="138" text-anchor="end" font-size="12">2480</text><line class="grid" x1="85" y1="45" x2="720" y2="45"/><text x="75" y="49" text-anchor="end" font-size="12">3100</text><line class="axis" x1="85" y1="45" x2="85" y2="490"/><line class="axis" x1="85" y1="490" x2="720" y2="490"/><text x="85" y="515" text-anchor="middle" font-size="13">1</text><text x="402.5" y="515" text-anchor="middle" font-size="13">2</text><text x="720" y="515" text-anchor="middle" font-size="13">4</text><text x="402.5" y="545" text-anchor="middle" font-size="13">API replicas</text><circle class="point" cx="85" cy="97.94469794128702" r="4" fill="#1a73e8"/><circle class="point" cx="402.5" cy="150.47324315126576" r="4" fill="#1a73e8"/><circle class="point" cx="720" cy="200.9869273874724" r="4" fill="#1a73e8"/><polyline class="line" points="85,97.94469794128702 402.5,150.47324315126576 720,200.9869273874724" stroke="#1a73e8"/><line x1="745" y1="65" x2="770" y2="65" stroke="#1a73e8" stroke-width="3"/><text x="778" y="69" font-size="12">fixed, c=32</text><circle class="point" cx="85" cy="97.59212639106859" r="4" fill="#d93025"/><circle class="point" cx="402.5" cy="174.50312647976264" r="4" fill="#d93025"/><circle class="point" cx="720" cy="188.14076549389546" r="4" fill="#d93025"/><polyline class="line" points="85,97.59212639106859 402.5,174.50312647976264 720,188.14076549389546" stroke="#d93025"/><line x1="745" y1="93" x2="770" y2="93" stroke="#d93025" stroke-width="3"/><text x="778" y="97" font-size="12">fixed, c=64</text><circle class="point" cx="85" cy="143.7066057420492" r="4" fill="#188038"/><circle class="point" cx="402.5" cy="133.35012431532638" r="4" fill="#188038"/><circle class="point" cx="720" cy="168.15646800421806" r="4" fill="#188038"/><polyline class="line" points="85,143.7066057420492 402.5,133.35012431532638 720,168.15646800421806" stroke="#188038"/><line x1="745" y1="121" x2="770" y2="121" stroke="#188038" stroke-width="3"/><text x="778" y="125" font-size="12">fixed, c=8</text><circle class="point" cx="85" cy="85.45454545454552" r="4" fill="#9334e6"/><circle class="point" cx="402.5" cy="135.30606743203387" r="4" fill="#9334e6"/><circle class="point" cx="720" cy="184.2610413680913" r="4" fill="#9334e6"/><polyline class="line" points="85,85.45454545454552 402.5,135.30606743203387 720,184.2610413680913" stroke="#9334e6"/><line x1="745" y1="149" x2="770" y2="149" stroke="#9334e6" stroke-width="3"/><text x="778" y="153" font-size="12">growing, c=32</text><circle class="point" cx="85" cy="196.57385409938001" r="4" fill="#f29900"/><circle class="point" cx="402.5" cy="168.53866266092896" r="4" fill="#f29900"/><circle class="point" cx="720" cy="223.13942705833085" r="4" fill="#f29900"/><polyline class="line" points="85,196.57385409938001 402.5,168.53866266092896 720,223.13942705833085" stroke="#f29900"/><line x1="745" y1="177" x2="770" y2="177" stroke="#f29900" stroke-width="3"/><text x="778" y="181" font-size="12">growing, c=64</text><circle class="point" cx="85" cy="100.60936627447775" r="4" fill="#00897b"/><circle class="point" cx="402.5" cy="123.35560037954652" r="4" fill="#00897b"/><circle class="point" cx="720" cy="176.3488242715569" r="4" fill="#00897b"/><polyline class="line" points="85,100.60936627447775 402.5,123.35560037954652 720,176.3488242715569" stroke="#00897b"/><line x1="745" y1="205" x2="770" y2="205" stroke="#00897b" stroke-width="3"/><text x="778" y="209" font-size="12">growing, c=8</text></svg>
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
@@ -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
|
||||
Reference in New Issue
Block a user