forked from mtusi2026/mtusi2026lab3
Track 1 of grade 5 is closed. At a fixed 4 CPU / 2 GiB the 1x4, 2x2 and 4x1 layouts peak at 5 375, 4 964 and 4 724 rps: within the hypothesised 15 percent, yet smaller replicas cost a third more CPU per request and reach a long tail earlier. Growing one-CPU replicas gives 1 720, 2 936, 4 724 and only 4 260 rps at eight, a retrograde curve with USL sigma 0.014 and kappa 0.038. The saturation point is the chat row lock in PostgreSQL: at eight replicas 47.5 of 64 connections wait for it while the API, the balancer and the database CPU still have room. Writing a message with one statement removed the application round trips from under the lock: p95 at 3 600 rps fell from 64.5 to 3.7 ms and the peak rose by 15 % with the same resources. The new lab3-scaling-cost spec is synced to openspec/specs, with the compare scenario stated as measured: below the knee fewer lock waits and a lower p95, past it a higher peak. AGENTS.md lists make track1 and make plots. The neighbour CPU sampler is stopped and its file closed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27