Skip to content

fix: [stable-8.0][OCISDEV-1724] reuse HTTP connections in the proxy - #13539

Merged
2403905 merged 2 commits into
stable-8.0from
fix/8.0/OCISDEV-1724
Nov 20, 2026
Merged

2403905 merged 2 commits into
stable-8.0from
fix/8.0/OCISDEV-1724

Conversation

@2403905

@2403905 2403905 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Under high load (k6 mixed test, 300 VUs), the proxy opens a new connection for most requests. The host runs out of ports. This causes failed logins and failed requests.

Ticket: OCISDEV-1724. The load test numbers and the analysis are in the ticket.

Change

  1. services/proxy/pkg/proxy/proxy.go: the backend transport keeps up to 100 idle connections for each backend. Before, it kept 2. It has no global limit for idle connections. In a deployment with one pod for each replica, each pod is one host.
  2. services/proxy/pkg/command/server.go: the OIDC client keeps its connections alive. Before, it used DisableKeepAlives: true and opened a new connection with a new TLS handshake for each call.
  3. Both close an idle connection after 30 seconds. Before, the proxy used 90 seconds. A load balancer or an ingress controller often closes an idle connection after 60 seconds. The proxy must close first. The Go transport does not repeat a PUT, POST or PROPFIND request on a connection that the other side closed.

Tests

  • Two bursts of 20 parallel requests go to a local server. The second burst must open at most 2 new connections.
  • Unit tests check the transport settings and that the OIDC client keeps connections alive.
  • I ran go test -race for ./services/proxy/.... All tests pass.
  • I did not run a load test with this version.

Not in this PR

  • The deprecated field DualStack of the dialer and the MPTCP settings stay unchanged. A separate ticket covers them.
  • This PR is a draft. The reva changes are in fix: [stable-8.0][OCISDEV-1724] reuse HTTP connections in the reva clients reva#824. After that PR is merged, this PR needs a bump of the reva version in go.mod.
  • The main cause of the churn is probably the gRPC connections to the settings service (port 9191). This PR does not change them. See the open questions in the ticket.
  • canCreateSpace in the graph service still turns a settings error into a 403. This is a separate fix.

🤖 Generated with Claude Code

@kw-security

kw-security commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@2403905
2403905 force-pushed the fix/8.0/OCISDEV-1724 branch from 0ca6477 to 7f94332 Compare November 20, 2026 11:42
2403905 and others added 2 commits November 20, 2026 12:42
Under high load, the proxy opened a new connection for most requests. The
host ran out of ports. This caused failed logins and failed requests.

1. The backend transport keeps up to 100 idle connections for each backend.
   Before, it kept 2. It has no global limit for idle connections.
2. The OIDC client keeps its connections alive. Before, it opened a new
   connection with a new TLS handshake for each call.
3. Both close an idle connection after 30 seconds. Before, the proxy used 90
   seconds. A load balancer or an ingress controller often closes an idle
   connection after 60 seconds. The proxy must close first.
4. The deprecated field DualStack is removed. It has no effect.

Tests send two bursts of parallel requests. The second burst reuses the idle
connections of the first burst.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
… dialer

The field DualStack of net.Dialer is deprecated and has no effect. This pull
request does not change it. A separate ticket covers the dialer settings.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
@2403905
2403905 force-pushed the fix/8.0/OCISDEV-1724 branch from 7f94332 to 17c76d9 Compare November 20, 2026 11:42
@2403905
2403905 marked this pull request as ready for review November 20, 2026 11:43
@2403905
2403905 requested a review from a team November 20, 2026 11:43
@2403905 2403905 changed the title fix: [stable-8.0][OCISDEV-1724] reuse HTTP connections in the proxy Draft fix: [stable-8.0][OCISDEV-1724] reuse HTTP connections in the proxy Nov 20, 2026
@2403905 2403905 changed the title Draft fix: [stable-8.0][OCISDEV-1724] reuse HTTP connections in the proxy DRAFT fix: [stable-8.0][OCISDEV-1724] reuse HTTP connections in the proxy Nov 20, 2026
@2403905 2403905 changed the title DRAFT fix: [stable-8.0][OCISDEV-1724] reuse HTTP connections in the proxy fix: [stable-8.0][OCISDEV-1724] reuse HTTP connections in the proxy Nov 20, 2026
@2403905
2403905 enabled auto-merge (squash) November 20, 2026 11:59
@2403905
2403905 merged commit c2a62f4 into stable-8.0 Nov 20, 2026
127 of 130 checks passed
@2403905
2403905 deleted the fix/8.0/OCISDEV-1724 branch November 20, 2026 12:48
2403905 added a commit that referenced this pull request Nov 20, 2026
Under high load, the proxy opened a new connection for most requests. The
host ran out of ports. This caused failed logins and failed requests.

1. The backend transport keeps up to 100 idle connections for each backend.
   Before, it kept 2. It has no global limit for idle connections.
2. The OIDC client keeps its connections alive. Before, it opened a new
   connection with a new TLS handshake for each call.
3. Both close an idle connection after 30 seconds. Before, the proxy used 90
   seconds. A load balancer or an ingress controller often closes an idle
   connection after 60 seconds. The proxy must close first.
4. Bump reva to get the same fix for the reva HTTP clients (owncloud/reva#826).

Tests send two bursts of parallel requests. The second burst reuses the idle
connections of the first burst.

Backport of #13539.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
2403905 added a commit that referenced this pull request Nov 20, 2026
Under high load, the proxy opened a new connection for most requests. The
host ran out of ports. This caused failed logins and failed requests.

1. The backend transport keeps up to 100 idle connections for each backend.
   Before, it kept 2. It has no global limit for idle connections.
2. The OIDC client keeps its connections alive. Before, it opened a new
   connection with a new TLS handshake for each call.
3. Both close an idle connection after 30 seconds. Before, the proxy used 90
   seconds. A load balancer or an ingress controller often closes an idle
   connection after 60 seconds. The proxy must close first.
4. Bump reva to get the same fix for the reva HTTP clients (owncloud/reva#825).

Tests send two bursts of parallel requests. The second burst reuses the idle
connections of the first burst.

Backport of #13539.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
2403905 added a commit that referenced this pull request Nov 20, 2026
* fix: [OCISDEV-1724] reuse HTTP connections in the proxy

Under high load, the proxy opened a new connection for most requests. The
host ran out of ports. This caused failed logins and failed requests.

1. The backend transport keeps up to 100 idle connections for each backend.
   Before, it kept 2. It has no global limit for idle connections.
2. The OIDC client keeps its connections alive. Before, it opened a new
   connection with a new TLS handshake for each call.
3. Both close an idle connection after 30 seconds. Before, the proxy used 90
   seconds. A load balancer or an ingress controller often closes an idle
   connection after 60 seconds. The proxy must close first.
4. Bump reva to get the same fix for the reva HTTP clients (owncloud/reva#825).

Tests send two bursts of parallel requests. The second burst reuses the idle
connections of the first burst.

Backport of #13539.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>

* fix: [OCISDEV-1724] bump reva to the merge commit

Reva merged the fix for the HTTP clients. Point go.mod to the merge commit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>

---------

Signed-off-by: Roman Perekhod <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
2403905 added a commit that referenced this pull request Nov 20, 2026
…13542)

* fix: [stable-9.0][OCISDEV-1724] reuse HTTP connections in the proxy

Under high load, the proxy opened a new connection for most requests. The
host ran out of ports. This caused failed logins and failed requests.

1. The backend transport keeps up to 100 idle connections for each backend.
   Before, it kept 2. It has no global limit for idle connections.
2. The OIDC client keeps its connections alive. Before, it opened a new
   connection with a new TLS handshake for each call.
3. Both close an idle connection after 30 seconds. Before, the proxy used 90
   seconds. A load balancer or an ingress controller often closes an idle
   connection after 60 seconds. The proxy must close first.
4. Bump reva to get the same fix for the reva HTTP clients (owncloud/reva#826).

Tests send two bursts of parallel requests. The second burst reuses the idle
connections of the first burst.

Backport of #13539.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>

* fix: [OCISDEV-1724] bump reva to the merge commit

Reva merged the fix for the HTTP clients. Point go.mod to the merge commit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>

---------

Signed-off-by: Roman Perekhod <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.

5 participants