|
| 1 | +# Cold Path Real E2E Performance Runbook |
| 2 | + |
| 3 | +## Goal |
| 4 | +Measure real `/music` cold-path latency using production-like traffic and parse structured `PERF|...` logs. |
| 5 | + |
| 6 | +## Scope |
| 7 | +- Primary path: first `/music` cold requests (cache miss) |
| 8 | +- Topologies: |
| 9 | + - `official_api` |
| 10 | + - `selfhost_api_uri_upload` (self-hosted API + URI upload mode) |
| 11 | + - `selfhost_api_multipart_upload` (self-hosted API + multipart upload mode) |
| 12 | +- Decision metric: `e2e_total` p95 |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | +1. Build and run the bot with `loglevel=info` or `loglevel=debug`. |
| 16 | +2. Ensure requests are cold path samples (avoid repeated same `music_id` cache hits). |
| 17 | +3. Collect logs to file. |
| 18 | + |
| 19 | +Example: |
| 20 | + |
| 21 | +```bash |
| 22 | +cargo run --release -- --config config.ini 2>&1 | tee data/manual-test/coldpath.log |
| 23 | +``` |
| 24 | + |
| 25 | +## Sampling Plan |
| 26 | +1. Official API: capture at least 30 cold-path requests. |
| 27 | +2. Self-hosted API mode (local or remote deployment): capture at least 30 cold-path requests. |
| 28 | +3. Separate self-hosted data by upload mode (`selfhost_api_uri_upload` vs `selfhost_api_multipart_upload`). |
| 29 | +4. Keep request set comparable (song size/category mix). |
| 30 | + |
| 31 | +## Parse and Report |
| 32 | +Generate overall report: |
| 33 | + |
| 34 | +```bash |
| 35 | +python3 scripts/perf_log_report.py \ |
| 36 | + --log-file data/manual-test/coldpath.log \ |
| 37 | + --cache-path miss_cold \ |
| 38 | + --markdown-output docs/perf/2026-02-20-coldpath-overall.md \ |
| 39 | + --json-output docs/perf/2026-02-20-coldpath-overall.json |
| 40 | +``` |
| 41 | + |
| 42 | +Generate per-topology reports: |
| 43 | + |
| 44 | +```bash |
| 45 | +python3 scripts/perf_log_report.py \ |
| 46 | + --log-file data/manual-test/coldpath.log \ |
| 47 | + --topology official_api \ |
| 48 | + --cache-path miss_cold \ |
| 49 | + --markdown-output docs/perf/2026-02-20-coldpath-official.md \ |
| 50 | + --json-output docs/perf/2026-02-20-coldpath-official.json |
| 51 | + |
| 52 | +python3 scripts/perf_log_report.py \ |
| 53 | + --log-file data/manual-test/coldpath.log \ |
| 54 | + --topology selfhost_api_uri_upload \ |
| 55 | + --cache-path miss_cold \ |
| 56 | + --markdown-output docs/perf/2026-02-20-coldpath-local-uri.md \ |
| 57 | + --json-output docs/perf/2026-02-20-coldpath-local-uri.json |
| 58 | +``` |
| 59 | + |
| 60 | +If URI upload is disabled in a run, use topology filter `selfhost_api_multipart_upload`. |
| 61 | + |
| 62 | +## Acceptance Rule |
| 63 | +- Soft target: cold-path `e2e_total` p95 improves by ~20%. |
| 64 | +- If target is not reached, still deliver: |
| 65 | + - stage-level p95 shares (`upload_send`, `tag_process`, `select_url`, `db_save`, etc.) |
| 66 | + - bottleneck evidence and next optimization priorities. |
| 67 | + |
| 68 | +## Reference (Synthetic) |
| 69 | +Synthetic benchmark remains useful for regression sanity checks only: |
| 70 | + |
| 71 | +```bash |
| 72 | +python3 scripts/perf_compare.py |
| 73 | +``` |
| 74 | + |
| 75 | +Do not use synthetic output as final optimization decision data. |
0 commit comments