proto-socket/agent-roadmap/archive/phase/stability-maintenance/milestones/nightly-large-payload-baseline.md

123 lines
12 KiB
Markdown

# 야간 대용량 패킷 성능 기준선
## 목표
대용량 payload 성능은 주간 작업 부하에 따른 편차가 크므로, 64KB/1MB 패킷 전송 성능의 기준선과 회귀 판단은 작업 부하가 낮은 야간 시간대에 별도로 수집한다. 주간 결과는 문제 재현이나 방향성 확인용 exploratory record로만 보고, baseline 또는 완료 판정 근거로 쓰지 않는다.
## 단계
안정화와 유지
## 상태
[완료]
## 구현 잠금
- 상태: 해제
- 결정 필요: 없음
## 범위
- 64KB/1MB payload 중심의 TCP/WS 성능 baseline을 야간 전용 record로 수집한다.
- 야간 실행 조건은 테스트 실행 host의 local time 기준 20:00 이후로 둔다.
- 가능하면 20:00-06:00 사이의 idle window에서 실행하고, 작업 중인 foreground build/test/editor 부하가 큰 시간대는 baseline에서 제외한다.
- Dart, Go, Kotlin, Python, TypeScript의 TCP/WS payload rows를 같은 host/runtime/profile에서 비교한다.
- TypeScript WS 1MB, Dart TCP/WS 1MB, Kotlin WS 1MB처럼 주간 측정에서 병목 또는 편차가 컸던 row를 우선 감시한다.
- stability hard gate는 기존 성능 기준과 동일하게 timeout, nonce mismatch, response type mismatch, FIFO violation, pending leak, queue/gateway backlog leak 0을 요구한다.
- 주간 측정 결과는 회귀 판정에 직접 쓰지 않고, 야간 재측정 후보를 고르는 참고 자료로만 사용한다.
## 기능
### Epic: [night-window] 야간 실행 조건
대용량 payload baseline은 낮 시간 작업 부하와 분리한다.
- [x] [time-window-rule] 64KB/1MB payload baseline 후보는 실행 host local time 기준 20:00 이후 시작한 record만 인정한다. 검증: 2026-06-10 실행 메모에 host local time `2026-06-10 21:18:24 KST +0900` full wrapper 시작과 `2026-06-10 21:40:06 KST` payload focused record 생성 근거를 남겼다.
- [x] [daytime-policy] 20:00 이전에 수집한 대용량 payload 결과는 exploratory record로 표시하고, baseline/regression 완료 근거에서 제외한다. 검증: 2026-06-10 완료 근거는 야간 focused record만 baseline 후보로 사용하고, 기존 주간/시간대 미확인 record는 방향성 비교용으로만 남겼다.
### Epic: [payload-baseline] 대용량 payload 기준선
작업 부하가 낮은 시간대에 같은 profile을 반복해 편차를 줄인다.
- [x] [night-full-record] 20:00 이후 `bash agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_performance.sh --full`을 실행해 야간 full performance record를 남긴다. 검증: `agent-test/runs/20260614-123328-proto-socket-performance-full.md`가 2026-06-14 21:33:16 KST 이후 시작한 야간 full record이며 overall PASS, same-language/cross-language/TypeScript gateway 구성요소 모두 PASS, same-language 5개 언어 각 34 rows, required skip 0, stability violations 0, 대용량 payload rows 포함으로 기록됐다. 진행 메모: 2026-06-10 21:18 KST에 시작했으나 Dart same-language full stress 단계가 20분 이상 record 없이 지속되어 중단했다. 2026-06-13/14 야간 full wrapper는 완료됐지만 same-language hard gate 실패가 있어 baseline 완료 근거로 쓰지 않는다.
- [x] [payload-focused-record] 20:00 이후 `run_stress.sh --full --profile payload` 계열 focused record를 수집해 64KB/1MB TCP/WS rows를 별도로 확인한다. 검증: `agent-test/runs/20260610-124006-proto-socket-stress-full.md`에서 Dart, Go, Kotlin, Python, TypeScript payload rows가 모두 PASS이고 stability violations 0으로 기록됐다.
- [x] [repeatability] 필요하면 2회 이상 반복해 p99/throughput 편차를 비교한다. 검증: `agent-test/runs/20260610-124006-proto-socket-stress-full.md``agent-test/runs/20260610-131132-proto-socket-stress-full.md`를 같은 host/runtime/profile의 night records로 비교했다. 모든 64KB/1MB row는 PASS/PASS와 stability violations 0을 유지했고, 편차가 큰 row는 baseline 확정값 대신 watchlist로 남겼다.
### Epic: [large-packet-watchlist] 큰 패킷 병목 감시
기존 최적화가 실제 idle 조건에서도 유지되는지 확인한다.
- [x] [dart-large-packet] Dart TCP/WS 64KB/1MB rows가 야간 기준에서도 안정성 hard gate를 유지하고, 주간 대비 방향성이 개선으로 유지되는지 확인한다. 검증: 2026-06-10 focused records에서 Dart 64KB/1MB TCP/WS 모두 PASS, stability violations 0. WS 1MB는 2회 모두 2026-06-07 full record 대비 개선됐고, TCP 1MB는 1회차 개선 후 2회차 p99가 141.681ms로 흔들려 watchlist에 남긴다.
- [x] [kotlin-ws-large-packet] Kotlin WS 64KB/1MB rows의 p99, throughput, memory, queue backlog를 야간 기준으로 다시 확인한다. 검증: Kotlin WS 64KB p99 13.461ms/13.049ms, throughput 1068.8/970.4rps, queue backlog 1/2; WS 1MB p99 75.940ms/100.032ms, throughput 113.6/92.6rps, queue backlog 1/1; stability violations 0. WS 1MB p99 편차는 watchlist로 남긴다.
- [x] [typescript-ws-large-packet] TypeScript WS 1MB row를 야간 기준으로 재측정하고, 병목이 여전히 남으면 다음 최적화 후보로 분리한다. 검증: TypeScript WS 1MB p99 226.008ms/237.395ms, throughput 33.5/33.3rps, stability violations 0. Go/Python reference 대비 낮은 throughput과 높은 p99가 반복되어 후속 최적화 후보로 남긴다.
- [x] [reference-large-packet] Go/Python TCP/WS 1MB rows를 야간 reference fast/medium path로 확정한다. 검증: 2026-06-10 focused record 2회에서 Go 1MB TCP p99 23.201ms/25.860ms, WS p99 28.900ms/27.239ms, Python 1MB TCP p99 16.776ms/20.399ms, WS p99 44.841ms/46.710ms, throughput은 Go TCP 436.9/431.7rps, Go WS 335.9/331.2rps, Python TCP 469.7/447.0rps, Python WS 177.9/175.9rps였고 모두 stability violations 0으로 기록됐다.
## 완료 리뷰
- 상태: 승인됨
- 요청일: 2026-06-15
- 완료 근거:
- `agent-test/runs/20260614-123328-proto-socket-performance-full.md`가 야간 full performance 기준을 만족하며 전체 결과값 PASS로 완료됐다.
- same-language, cross-language, TypeScript gateway 구성요소가 모두 PASS이고 same-language stability violations는 0이다.
- 사용자 요청에 따라 코드레벨 검토 완료 상태에서 방금 야간 full record evidence를 검토했고, 완료/archive 진행이 승인됐다.
- 리뷰 필요:
- [x] 사용자가 완료 결과를 확인했다
- [x] archive 이동을 승인했다
- 리뷰 코멘트: 2026-06-15 사용자 요청: "방금 작업에 대해 검토하고 마일스톤 완료 해도 될거 같으면 완료시켜". 검토 결과 야간 full performance evidence가 완료 조건을 충족해 Milestone을 완료 처리한다.
## 범위 제외
- 이번 마일스톤은 즉시 코드 최적화를 수행하지 않는다.
- 야간 record 없이 주간 결과만으로 성능 회귀 또는 개선을 확정하지 않는다.
- 서로 다른 host/runtime/profile의 절대 throughput/p99를 직접 비교하지 않는다.
- package registry release, 외부 CI/CD runner 연결, C#/Swift 포팅은 포함하지 않는다.
## 작업 컨텍스트
- 관련 경로: `agent-test/local/proto-socket-performance-baseline.md`, `agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_performance.sh`, `agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_stress.sh`, `agent-test/runs/`
- 선행 작업: `언어별 성능 병목 개선`, `성능 기록 판정 자동화`
- 후속 작업: `대용량 WS/병렬 전송 후속 최적화` 스케치에서 야간 기준에서도 병목이 유지되는 row를 구현 후보로 승격한다.
- 표준선: 대용량 payload baseline은 실행 host local time 기준 20:00 이후 시작한 결과만 인정한다.
## 2026-06-10 진행 메모
- host local time 확인: `2026-06-10 21:18:24 KST +0900`.
- full wrapper 시도: `bash agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_performance.sh --full`.
- full wrapper 결과: `/tmp/proto-socket-performance.yAs0NV/same-language.log`에 Dart same-language full stress 시작만 남고 20분 이상 record가 생성되지 않아 중단했다. 중단 시 실행 중이던 프로세스 그룹은 종료 확인했다.
- payload focused 실행: `bash agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_stress.sh --full --profile payload`.
- payload focused 결과: `agent-test/runs/20260610-124006-proto-socket-stress-full.md`, overall PASS, 언어별 PASS 5/5, required skip 0, stability violations 0.
- 주요 watchlist: Dart TCP/WS 1MB PASS, Kotlin WS 64KB/1MB PASS, TypeScript WS 1MB PASS이나 p99 226.008ms와 33.5rps로 후속 최적화 후보 유지, Go/Python 1MB reference rows PASS.
- 2회차 host local time 확인: `2026-06-10 22:11:12 KST +0900`.
- 2회차 payload focused 결과: `agent-test/runs/20260610-131132-proto-socket-stress-full.md`, overall PASS, 언어별 PASS 5/5, required skip 0, stability violations 0.
- 1회차 대비 2회차 반복성: 모든 64KB/1MB row가 PASS/PASS를 유지했다. TypeScript WS 1MB는 p99 226.008ms -> 237.395ms, throughput 33.5rps -> 33.3rps로 병목이 안정적으로 재현됐다. Dart TCP 1MB, Kotlin TCP/WS 1MB, Go WS 64KB는 p99 편차가 커서 baseline 확정값 대신 watchlist로 둔다.
## 2일차 핸드오프
- 실행 전 host local time이 20:00 이후인지 `date '+%Y-%m-%d %H:%M:%S %Z %z'`로 먼저 남긴다.
- 1순위는 full performance record 재수집이다: `bash agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_performance.sh --full`.
- full wrapper가 다시 오래 걸리면 Dart same-language full stress에서 멈추는지 먼저 확인하고, full wrapper 완료 전에 baseline 완료 판정을 하지 않는다.
- 2순위는 필요 시 다른 야간 window repeatability 강화다: `bash agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_stress.sh --full --profile payload`를 한 번 더 실행해 2026-06-10 2회 기록과 p99/throughput 편차를 비교한다.
- 20:00 이전 결과나 host timezone 확인이 없는 결과는 baseline/regression 완료 근거가 아니라 exploratory 또는 방향성 참고로만 사용한다.
## 2026-06-13/14 진행 메모
- host local time 확인: `2026-06-13 23:14:52 KST +0900`.
- full wrapper 실행: `bash agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_performance.sh --full`.
- full wrapper 결과: `agent-test/runs/20260613-141506-proto-socket-performance-full.md`, overall FAIL, regression SKIPPED.
- 구성요소 결과: same-language FAIL, cross-language PASS (`agent-test/runs/20260613-202101-proto-socket-stress-full-cross.md`), TypeScript gateway PASS (`agent-test/runs/20260613-202744-proto-socket-stress-full.md`).
- same-language 기록: `agent-test/runs/20260613-141506-proto-socket-stress-full.md`; Dart/Go/Python PASS, Kotlin INCOMPLETE(required skip 3, 기존 deferred TCP parallel clients>=128), TypeScript FAIL(stability violations 92).
- hard gate 실패 row: TypeScript TCP `parallel clients=1024`, requests 511908/512000, timeout 92, p99 126.875ms, throughput 22134.4rps, 결과 FAIL.
- 대용량 payload rows는 full record에 포함됐고 TypeScript TCP/WS 1MB payload는 PASS였지만, same-language hard gate 실패 때문에 full baseline 완료 근거로 쓰지 않는다.
## 2026-06-14/15 완료 메모
- host local time 확인: `2026-06-14 21:33:16 KST +0900`.
- full wrapper 실행: `bash agent-ops/skills/project/run-proto-socket-test-matrix/scripts/run_performance.sh --full`.
- full wrapper 완료 확인: `2026-06-15 03:47:58 KST +0900`.
- full wrapper 결과: `agent-test/runs/20260614-123328-proto-socket-performance-full.md`, overall PASS, regression SKIPPED(비교 baseline 없음).
- 구성요소 결과: same-language PASS (`agent-test/runs/20260614-123328-proto-socket-stress-full.md`), cross-language PASS (`agent-test/runs/20260614-184040-proto-socket-stress-full-cross.md`), TypeScript gateway PASS (`agent-test/runs/20260614-184719-proto-socket-stress-full.md`).
- same-language 결과: Dart/Go/Kotlin/Python/TypeScript 모두 PASS, 각 34 rows, SKIP 0, required skip 0, stability violations 0.
- 이전 실패 지점이던 TypeScript TCP `parallel clients=1024,topology=split-process` row는 PASS, timeout 0, p99 75.826ms, throughput 47716.5rps로 기록됐다.
- 대용량 payload rows는 TCP/WS 64KB/1MB 전 언어에서 PASS와 stability violations 0을 유지했다.
- 이번 마일스톤은 즉시 코드 최적화를 수행하지 않고 야간 기준선 수집/완료 판정까지만 다룬다. 후속 최적화 후보는 활성 `대용량 WS/병렬 전송 후속 최적화` 마일스톤에서 계속 다룬다.