[PR #393] [MERGED] fix(gateway): size reverse proxy idle connection pools for node fan-out #400

Closed
opened 2026-10-29 14:23:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/393
Author: @guozy18
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @yingdi-shan

Base: main ← Head: sync/gateway-connection-pool


📝 Commits (1)

  • 0826e9f fix(gateway): size reverse proxy idle connection pools for node fan-out

📊 Changes

1 file changed (+20 additions, -0 deletions)

View changed files

📝 services/gateway/internal/server.go (+20 -0)

📄 Description

What

Reuse a dedicated HTTP transport across gateway reverse proxies, retaining up to 128 idle connections per backend host.

Why

The default two idle connections per host cause avoidable connection churn under concurrent node fan-out.

N/A — focused synchronization of an existing implementation.

Scope and non-goals

Gateway proxy transport.

Design and behavior changes

Clone the default transport, remove the global idle-connection limit, and set MaxIdleConnsPerHost to 128. Preserve the default idle timeout and the main branch API-key handling.

Compatibility and operations

  • Public API or generated protocol: No API change.
  • Configuration or defaults: Gateway idle pool changes as described above.
  • Snapshot manifest, artifact layout, or storage format: unchanged.
  • Upgrade and rollback: ordinary code upgrade/revert; no data migration.
  • Host requirements, permissions, ports, or dependencies: unchanged.

Validation

PASS: make -C services test fmt-check vet
PASS: (cd services && go test ./...)
PASS: git diff --check

Validated independently on upstream main 949cec2 plus this single commit, using the existing gateway, scheduler and shared-package suites.

Risks and reviewer notes

Idle connections can grow with backend count; the per-host limit and idle timeout bound retention. No throughput benchmark was run.

The original author, author date and commit message are preserved. Main-branch adaptations are described above.

Checklist

  • One coherent change with no unrelated refactors.
  • Validation scope and execution limitations are stated.
  • No credentials or private deployment configuration included.
  • Generated code, where changed, was regenerated from the updated schema.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/393 **Author:** [@guozy18](https://github.com/guozy18) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `sync/gateway-connection-pool` --- ### 📝 Commits (1) - [`0826e9f`](https://github.com/kvcache-ai/AgentENV/commit/0826e9faca91376b2e76af31cc3822b49233818b) fix(gateway): size reverse proxy idle connection pools for node fan-out ### 📊 Changes **1 file changed** (+20 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `services/gateway/internal/server.go` (+20 -0) </details> ### 📄 Description ## What Reuse a dedicated HTTP transport across gateway reverse proxies, retaining up to 128 idle connections per backend host. ## Why The default two idle connections per host cause avoidable connection churn under concurrent node fan-out. ## Related issue N/A — focused synchronization of an existing implementation. ## Scope and non-goals Gateway proxy transport. ## Design and behavior changes Clone the default transport, remove the global idle-connection limit, and set MaxIdleConnsPerHost to 128. Preserve the default idle timeout and the main branch API-key handling. ## Compatibility and operations - Public API or generated protocol: No API change. - Configuration or defaults: Gateway idle pool changes as described above. - Snapshot manifest, artifact layout, or storage format: unchanged. - Upgrade and rollback: ordinary code upgrade/revert; no data migration. - Host requirements, permissions, ports, or dependencies: unchanged. ## Validation ```text PASS: make -C services test fmt-check vet PASS: (cd services && go test ./...) PASS: git diff --check ``` Validated independently on upstream main 949cec2 plus this single commit, using the existing gateway, scheduler and shared-package suites. ## Risks and reviewer notes Idle connections can grow with backend count; the per-host limit and idle timeout bound retention. No throughput benchmark was run. The original author, author date and commit message are preserved. Main-branch adaptations are described above. ## Checklist - [x] One coherent change with no unrelated refactors. - [x] Validation scope and execution limitations are stated. - [x] No credentials or private deployment configuration included. - [x] Generated code, where changed, was regenerated from the updated schema. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:23:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#400
No description provided.