Skip to content

v2.2.2: bound proxy memory and batch decision logs - #188

Merged
fifthsegment merged 1 commit into
masterfrom
perf/bounded-proxy-logging
Sep 24, 2026
Merged

fifthsegment merged 1 commit into
masterfrom
perf/bounded-proxy-logging

Conversation

@fifthsegment

Copy link
Copy Markdown
Owner

Summary

  • make proxy forwarding constant-memory by replacing payload retention with byte accounting
  • use one bounded inspection buffer and stream known/non-inspectable or oversized responses in order
  • persist decisions through a bounded queue with batched BuntDB transactions, brief backpressure, health counters, retries, flush, and close barriers
  • coordinate web, DNS, transparent proxy, Bonjour, and logger shutdown
  • release as v2.2.2 with updated changelog

Performance

Proxy, 16 MiB payload

Benchmark Before After
Forwarding allocation ~87.25 MB/op, 26 allocs 96 B/op, 2 allocs
Known oversized response — 8.36–8.99 µs, 33,552 B/op
Unknown oversized response — 48.62–51.87 µs, 179,498 B/op

Decision logger

Benchmark Before After
Persist 1,000 entries 17.80–23.08 ms 13.29–14.05 ms
Persist allocations 17,232–17,626 11,298–11,300
Admit/persist 10,000 entries 156k–167k allocs ~112,648 allocs

The proxy accounting benchmark uses io.Discard; the meaningful comparison is retained allocation rather than synthetic throughput.

Verification

  • make verify
  • make proxy-smoke
  • go test -race ./gatesentryproxy/...
  • go test -race ./application/logger/... ./application/dns/server/... ./application/webserver/endpoints/...
  • git diff --check

Full root go test -race ./... still reports pre-existing races in the third-party Bonjour implementation and shared DNS statistics; focused race suites for the changed proxy/logger paths pass.

🤖 Generated with [CC]

Stream proxy payloads without retaining complete downloads, use one bounded inspection buffer, and preserve oversized response ordering. Batch decision persistence through a bounded queue with graceful flush and shutdown semantics.

Co-Authored-By: [CC] <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 48.84080% with 331 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.12%. Comparing base (f271200) to head (0a7e548).

Files with missing lines Patch % Lines
application/start.go 0.00% 90 Missing ⚠️
application/logger/logger.go 70.33% 52 Missing and 18 partials ⚠️
gatesentryproxy/proxy.go 76.00% 26 Missing and 10 partials ⚠️
application/bonjour.go 0.00% 30 Missing ⚠️
application/dns/server/server.go 0.00% 29 Missing ⚠️
application/dns.go 0.00% 25 Missing ⚠️
gatesentryproxy/transparent_listener.go 0.00% 17 Missing ⚠️
application/service.go 0.00% 8 Missing ⚠️
application/webserver/webserver.go 0.00% 8 Missing ⚠️
application/runtime.go 57.14% 3 Missing and 3 partials ⚠️
... and 4 more
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #188      +/-   ##
==========================================
+ Coverage   50.46%   51.12%   +0.65%     
==========================================
  Files         128      128              
  Lines       12253    12669     +416     
==========================================
+ Hits         6184     6477     +293     
- Misses       5308     5414     +106     
- Partials      761      778      +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fifthsegment
fifthsegment merged commit e8fe85e into master Sep 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants