Skip to content

Increase default network-concurrency #10068

@SukkaW

Description

@SukkaW

Contribution

Describe the user story

In Bun's blog Behind The Scenes of Bun Install, they described how they make bun install fast.

We will ignore all their "reducing syscalls" or "async dns resolution only for macOS" bullshit from that post. Since we already know that one of the biggest performance overheads is the Network, they mentioned using 64 concurrent network connections by default:

Bun maintains a pool of 64(!) concurrent HTTP connections (configurable via BUN_CONFIG_MAX_HTTP_REQUESTS) on dedicated network threads.

pnpm currently sets network-concurrency to 16 by default.

Describe the solution you'd like

pnpm could implement two new configurations replacing the existing network-concurrency option: min-network-concurrency and max-network-concurrency. pnpm will start with max-network-concurrency, and when it hits TimeoutError, or Read Stream EOF, or any similar network error, pnpm will scale back network concurrency until reaching min-network-concurrency.

Describe the drawbacks of your solution

pnpm has way wider adoption than Bun. While Bun can increase their network concurrency to 64, DoS-ing registry w/o significant consequences, this doesn't apply to pnpm. pnpm is way more popular, and the impact will be noticeable.

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions