Skip to content

fix(network): stop capping the package manager's sockets at 15 by default - #10782

Merged
zkochan merged 2 commits into
teambit:masterfrom
zkochan:network/engine-max-sockets-default
Oct 9, 2026
Merged

zkochan merged 2 commits into
teambit:masterfrom
zkochan:network/engine-max-sockets-default

Conversation

@zkochan

@zkochan zkochan commented Oct 9, 2026

Copy link
Copy Markdown
Member

Proposed Changes

  • Http.getNetworkConfig() no longer fills in maxSockets: 15 when network.max_sockets is unset. The value reached the pnpm engine through the dependency resolver's network config, and the Rust engine applies maxSockets as a hard per-registry limit on in-flight requests, so every install downloaded through at most 15 connections to the registry. With the setting unset, the engine now applies its own default (64 to 96 connections, by CPU count). This mirrors the existing treatment of networkConcurrency a few lines below.
  • Bit's own HTTP agent, used for scope requests, keeps the default of 15. Http.getAgent applies it through a small withAgentSocketDefault helper, with a spec.
  • Measured in the ripple container signing a component whose capsule has about 5,500 dependencies, with a cold store and every package from node-registry.bit.cloud: the capsule's install went from 142 s to 71 s, and the whole sign up to the first build task from 5 min 03 s to 4 min 16 s. The same sign on the previous image, with Bit 1.13.226 and pnpm v10, took 4 min 25 s. The old engine had the same 15-socket cap, but its downloads overlapped resolution closely enough to hide it.

🤖 Generated with Claude Code

…ault

`Http.getNetworkConfig()` filled in `maxSockets: 15` when
`network.max_sockets` was unset, and that value reached the pnpm engine
through the dependency resolver's network config. The Rust engine applies
`maxSockets` as a hard per-registry limit on in-flight requests, so every
install downloaded through at most 15 connections to the registry.

The network config now leaves `maxSockets` unset unless the user
configured it, as it already does for `networkConcurrency`, and the
engine applies its own default. Bit's own HTTP agent keeps the default of
15, applied where the agent is built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Stop capping package-manager downloads at 15 sockets by default

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Leave maxSockets unset for installs so the pnpm engine can choose its default.
Diagram

graph TD
  Settings["Network settings"] --> Config["HTTP network config"] --> Resolver["Dependency resolver"] --> Engine["pnpm engine"]
  Config --> Agent["Bit HTTP agent"]
Loading
High-Level Assessment

Keep the default at the agent boundary. Raising the shared default would still override the engine, while filtering it in the dependency resolver would add special-case wiring. The PR separates the two consumers at the point where their needs differ.

Files changed (3) +34 / -2

Bug fix (1) +16 / -2
http.tsSeparate package-manager and Bit agent socket defaults +16/-2

Separate package-manager and Bit agent socket defaults

• Leaves maxSockets undefined in shared network configuration unless configured, allowing the package-manager engine to select its default. Applies the existing 15-socket fallback when constructing Bit's HTTP agent, while preserving an explicit value.

scopes/scope/network/http/http.ts

Tests (1) +12 / -0
http.spec.tsTest the HTTP agent socket fallback +12/-0

Test the HTTP agent socket fallback

• Checks that the agent helper uses 15 sockets when no value is configured and preserves a configured value.

scopes/scope/network/http/http.spec.ts

Other (1) +6 / -0
pnpm-lock.yamlRegister Chai test dependencies for the network component +6/-0

Register Chai test dependencies for the network component

• Adds chai and @types/chai to the network component's lockfile dev dependencies for the new spec.

pnpm-lock.yaml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 15d44f2 ⚖️ Balanced

Results up to commit d539692


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 15d44f2

@zkochan
zkochan merged commit 1b4da37 into teambit:master Oct 9, 2026
19 checks passed
zkochan added a commit that referenced this pull request Oct 10, 2026
## Proposed Changes

- Bumps `@pnpm/napi` to 12.11.1, which ships pnpm/pnpm#16783: an install
with `enableModulesDir: false` fetches the registry packages the host
can install into the store while still writing no `node_modules`, as
pnpm v10 did.
- fusepm installs that way and mounts `node_modules` from the store.
With 12.11.0 nothing was fetched, so the FUSE daemon downloaded every
package on first access: in the ripple container, compiling a component
whose capsule has about 5,500 dependencies took 3 minutes instead of 8
seconds.
- Related: #10782, which stops capping the engine at 15
sockets per registry, is needed to match the previous image's overall
sign time.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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