You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The proxy's network-log throughput figure (bytes_out / transfer_ms) over-reports ~1000× on small/sub-buffer transfers: transfer_ms times only the proxy's write+flush, which returns once the kernel accepts the bytes into the socket send buffer — NOT when they reach the client. tc HTB shaping drains the qdisc below the socket, so a sub-buffer segment (~50–140 KB) is absorbed instantly and reads as 1000s of Mbps while the wire is actually capped near the video bitrate.
This is the server-side gap behind the whole iOS ABR over-read investigation — the init-segment "6–17 Mbps" garbage and the cold-start over-selection wedge (see the avplayer-cold-start-wedge finding). We've been sidestepping it with mbps_transfer_rate; this is the honest fix.
WIP (already started, preserved on a branch)
A delivery_rate feature samples the kernel's tcpi_delivery_rate (getsockopt(TCP_INFO)) on the client socket at end-of-transfer and records delivery_rate_mbps on each network-log entry — the kernel's own estimate of the actual drained-onto-the-wire rate. Connection-level (under HTTP/2 it reflects the whole socket, not one stream); Linux-only with a macOS no-op stub so the dev build compiles.
Branch:fix/network-log-delivery-rate @ 40f5f4a2 (pushed). NOTE: committed on a stale base (the #823 point), so it needs reconciling onto current dev.
go-proxy/cmd/server/main.go — NetworkLogEntry.DeliveryRateMbps field + 2 call sites in handleProxy
go-proxy/cmd/server/v2_adapter.go — surfaces delivery_rate_mbps in networkEntryToMap
To revisit
Reconcile the WIP commit onto current dev (cherry-pick/rebase; the main.go/v2_adapter.go anchors may have moved).
Verify the linux build — confirm the tcpConnFromContext(r.Context()) helper exists (or is part of the WIP) and the TCP conn is reachable from the request context on both write paths.
Plumb delivery_rate_mbps end-to-end (the field-plumbing checklist: NetworkLogEntry → v2_adapter → forwarder → ClickHouse schema → dashboard) so it's queryable and chartable alongside the existing throughput series.
This gives the honest server-side shaped-rate signal the ABR/startup work kept lacking — directly useful for confirming throttle accuracy and diagnosing the init/small-file over-read without trusting bytes_out/transfer_ms.
Context
The proxy's network-log throughput figure (
bytes_out / transfer_ms) over-reports ~1000× on small/sub-buffer transfers:transfer_mstimes only the proxy's write+flush, which returns once the kernel accepts the bytes into the socket send buffer — NOT when they reach the client. tc HTB shaping drains the qdisc below the socket, so a sub-buffer segment (~50–140 KB) is absorbed instantly and reads as 1000s of Mbps while the wire is actually capped near the video bitrate.This is the server-side gap behind the whole iOS ABR over-read investigation — the init-segment "6–17 Mbps" garbage and the cold-start over-selection wedge (see the
avplayer-cold-start-wedgefinding). We've been sidestepping it withmbps_transfer_rate; this is the honest fix.WIP (already started, preserved on a branch)
A
delivery_ratefeature samples the kernel'stcpi_delivery_rate(getsockopt(TCP_INFO)) on the client socket at end-of-transfer and recordsdelivery_rate_mbpson each network-log entry — the kernel's own estimate of the actual drained-onto-the-wire rate. Connection-level (under HTTP/2 it reflects the whole socket, not one stream); Linux-only with a macOS no-op stub so the dev build compiles.Branch:
fix/network-log-delivery-rate@40f5f4a2(pushed). NOTE: committed on a stale base (the #823 point), so it needs reconciling onto currentdev.Files:
go-proxy/cmd/server/delivery_rate.go—stampDeliveryRate(conn, entry)go-proxy/cmd/server/delivery_rate_linux.go(//go:build linux) —readDeliveryRateBpsviagetsockopt(TCP_INFO)go-proxy/cmd/server/delivery_rate_other.go(//go:build !linux) — stubgo-proxy/cmd/server/main.go—NetworkLogEntry.DeliveryRateMbpsfield + 2 call sites inhandleProxygo-proxy/cmd/server/v2_adapter.go— surfacesdelivery_rate_mbpsinnetworkEntryToMapTo revisit
dev(cherry-pick/rebase; themain.go/v2_adapter.goanchors may have moved).tcpConnFromContext(r.Context())helper exists (or is part of the WIP) and the TCP conn is reachable from the request context on both write paths.delivery_rate_mbpsend-to-end (the field-plumbing checklist: NetworkLogEntry → v2_adapter → forwarder → ClickHouse schema → dashboard) so it's queryable and chartable alongside the existing throughput series.Why it matters
This gives the honest server-side shaped-rate signal the ABR/startup work kept lacking — directly useful for confirming throttle accuracy and diagnosing the init/small-file over-read without trusting
bytes_out/transfer_ms.🤖 Generated with Claude Code