cache: Per-client fair-share bandwidth on table uplink #54
Reference in New Issue
Block a user
Delete Branch "cache/per-client-uplink-fair-share"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Table-tier (LAN-party floor) boxes share a thin uplink to the backroom. Today only
max_requests_per_clientlimits concurrency, so one hungry download can still starve others on bytes/sec.What
uplink_bandwidth(go-units human size → bytes/sec) andmax_bytes_per_client_per_sec(absolute cap). Empty/0 = off (previous unlimited behavior).uplink/N(min with absolute cap when both set).golang.org/x/time/ratetoken buckets;limitedResponseWriterwraps content paths after special endpoints.max_requests_per_clientunchanged).How tested
go test -count=1 ./config/ ./steamcache/on jumpbox (includes fair-share unit tests, absolute-cap writer timing, ServeHTTP shaping with Steam UA).Risks
Rollback
git revertthe merge commit (or close PR without merging).Fixes #42
Bouncing — CI red on head
b7710de0.CI / check-and-test failed at golangci-lint (goimports ×4):
cmd/root.go:23config/config.go:24config/config_test.go:215steamcache/bandwidth_test.go:96vulncheck green. Not merging until check-and-test is green (
gofmt/goimportsthose files and push).Re-review after goimports fix on
25622cb.Prior bounce (goimports ×4) fixed; CI runs 1566/1567 green (check-and-test + vulncheck). Fair-share limiter + limitedResponseWriter look sound; empty/0 config = off preserved. Merging.