Files
anonymous_github/backend/reports/streaming-investigation.json

85 lines
3.2 KiB
JSON

{
"verifiedAt": "2026-11-03T20:18:57.814099+00:00",
"image": "sha256:4a44b2afed6fe4e9bd526c0cf1874a1baeca531fdf473ab14a328b693b0b68e5",
"implemented": [
"ZIP compression flush after authorized entry payload, first entry immediately and subsequent entries at most once per 250ms.",
"Flush archive and HTTP buffers together; X-Accel-Buffering: no disables nginx buffering for ZIP responses.",
"Check request cancellation between ZIP copy reads.",
"Record client headers and first body-byte timings in beta validation."
],
"before": {
"firstBodyByteMs": [
3575,
3341,
3347
],
"medianFirstBodyByteMs": 3347,
"totalMs": [
4396,
4067,
4125
],
"medianTotalMs": 4125,
"bytes": [
7166,
7166,
7166
]
},
"after": {
"firstBodyByteMs": [
1124,
1220,
1109
],
"medianFirstBodyByteMs": 1124,
"totalMs": [
4345,
4201,
4014
],
"medianTotalMs": 4201,
"bytes": [
7191,
7191,
7191
]
},
"firstBodyLatencyReductionPercent": 66.4,
"validation": {
"targetedRaceTests": "passed, 2.854s server; streaming payload gate, ZIP CRC/output, cancellation, integration ZIP and shared cache/HTTP paths",
"vet": "passed",
"liveChecksBefore": 131,
"liveChecksAfter": 130,
"result": "passed",
"temporaryKeysRevoked": true,
"temporaryRepositoriesRemoved": true,
"decodedContentAndCRC": "passed; repeated ZIP bytes identical within each run"
},
"tradeoffs": [
"Sync flush slightly increases ZIP size.",
"Authorization remains per-entry and serial; this reduces initial body latency, not total authorization work.",
"A partial ZIP cannot be opened as a complete archive until its central directory arrives.",
"Entry copies are synchronous and respect transport backpressure; no producer queue or archive-sized memory buffer added."
],
"remainingFindings": [
{
"area": "Cold text transforms",
"finding": "Worker spools input, processes whole-file regex, and publishes output before serving. Generic chunking can change regex matches or leak boundary-spanning terms. A streaming fast path needs a provably bounded pattern subset."
},
{
"area": "Large ZIP metadata",
"finding": "ZIP loads up to 100000 file rows before streaming. A Mongo cursor with projection would reduce metadata memory and preparation latency; name collision detection must remain."
},
{
"area": "ZIP compression",
"finding": "Cached gzip results are decoded and recompressed for ZIP. Raw deflate reuse could reduce CPU, but needs gzip-header/trailer, CRC and size validation plus corruption tests."
},
{
"area": "Large/slow downloads",
"finding": "Server has a two-minute absolute write deadline. Consider bounded idle write deadlines for long active streams, retaining protection from stalled clients."
}
],
"methodology": "Three sequential samples per deployment through https://beta.durieux.me. Existing source caches may be warm. Client firstBodyByteMs measures actual body arrival, not only response headers. Not a load test.",
"productionChanged": false
}