Skip to content

perf: make agent tunnel and HTTP/2 windows configurable - #4662

Merged
kmendell merged 3 commits into
mainfrom
perf/edge-tunnel-throughput
Nov 5, 2026
Merged

kmendell merged 3 commits into
mainfrom
perf/edge-tunnel-throughput

Conversation

@kmendell

@kmendell kmendell commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Checklist

  • This PR is not opened from my fork's main branch
  • All new user-facing strings are translated via Paraglide (m.*())

What This PR Implements

Makes the agent tunnel and manager HTTP/2 receive windows configurable, and moves environment settings from manager-pushed to per-environment.

Fixes: No issue linked yet.

Changes Made

  • Tunnel buffers: the tunnel reuses receive buffers and uses a custom gRPC codec for MuxData (pkg/agent/tunnel.go).
  • Windows from settings:
    • http2ReceiveWindowMb sets the manager's HTTP/2 receive window. Default is 32 MiB per stream and 64 MiB per connection, up from 8 and 16 MiB.
    • agentTunnelStreamWindowMb sets the agent tunnel stream window. The tunnel client and server both read it.
  • Tunnel settings: new Tunnel tab on environments, plus a /settings/tunnel page. The HTTP/2 window is labelled manager only.
  • Removed manager-to-agent settings push: the sync worker, its startup and shutdown hooks, PropagatedKeys(), and the propagate tag are gone. Timeouts, build provider, builds directory, build timeout, Depot project, and Trivy resource limits are now edited per environment.
  • Tests: 7 tests that only covered the push feature are deleted. New bootstrap test checks the HTTP/2 window defaults and bounds from settings.

Testing Done

  • just format all: clean
  • golangci-lint on bootstrap and settings: 0 issues
  • Go tests pass for settings, bootstrap (including app startup wiring), config/schema, agent, and imageupdate
  • Frontend check and lint pass

Not verified:

  • Settings pages in a browser
  • A real agent connection
  • Throughput before/after numbers. None are in this description yet.
  • Full just lint all and the full test suite. These are left to CI.

AI Tool Used (if applicable)

Additional Context

  • Existing agents keep the values the manager last pushed. Change them per environment, or use "All environments" on the settings page.
  • The HTTP/2 window change takes effect after a manager restart.
  • The Trivy resource limit fields only appear on environments with vulnerability scanning enabled.

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

To have Greptile Re-Review the changes, mention greptileai.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issue remains.

Summary

Makes tunnel windows configurable and removes manager-to-agent settings pushes.

  • Agent and manager tunnel receive windows can now be tuned from settings.
  • Large gRPC tunnel frames reuse receive buffers instead of allocating each time.
  • Environment settings stay with their environment instead of being pushed by the manager.
  • SSE event streams can keep writing for up to one hour.

Reviews (3) · Last reviewed commit: "fix: bound mux window capability parse t..." · Reviewed by Greptile

- Add agentTunnelStreamWindowMb and http2ReceiveWindowMb settings
- Apply them to the agent tunnel stream window and the HTTP/2 server receive window
- Add a Tunnel settings page
- Remove settings propagation to remote agents, including the timeout sync worker
@kmendell
kmendell requested a review from a team November 5, 2026 20:13
Comment thread backend/pkg/agent/mux.go Fixed
Comment thread backend/pkg/agent/tunnel.go Resolved
Comment thread frontend/messages/en.json Resolved
Comment thread backend/internal/settings/model_test.go Resolved
- Show the HTTP/2 receive window and stream window fields on the tunnel tab only when the environment reports them
- Rename buffer window i18n keys to buffer_windows and value_in_mib
- Parse the mux window capability as uint32 before clamping to 1-64 MiB
- Set the SSE write timeout to one hour
- Add codec tests for pooled and fallback mux data decoding
- Reformat test table literals to one field per line
@kmendell

kmendell commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Note

🤖 Claude Opus 5.5 responding on behalf of Kyle Mendell

@greptileai review

Comment thread backend/pkg/agent/mux.go Fixed
greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 5, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review November 5, 2026 20:51

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@kmendell
kmendell merged commit 83f46c9 into main Nov 5, 2026
21 checks passed
@kmendell
kmendell deleted the perf/edge-tunnel-throughput branch November 5, 2026 20:57
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