Set UV_THREADPOOL_SIZE dinamically on startup
Open
Nobody has claimed this yet.
benchmark-needed
- Dominant language
- Shell
- Stars
- 399
- Forks
- 11
- Avg merge
- 29m
- Merged PRs (30d)
- 1
Description
Thread: https://openjs-foundation.slack.com/archives/C049LSE8QBH/p1769010116581549
We came up with a default idea that switching the default 4 threads to:
UV_THREADPOOL_SIZE="$(getconf _NPROCESSORS_ONLN) > 4 ? (getconf _NPROCESSORS_ONLN) : 4"
Might have a good impact on powerful machines. However, before taking any action, we should have some measurements:
- Benchmark a different set of machines
- 4vCPUs
- 2vCPUs
- 8vCPUs
- Define a minimal HTTP server that serves a file
- Provide load on it until 4 threads become saturated (define the threshold)
- Bump UV_THREADPOOL_SIZE and see how it behaves.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the benchmark plan in this issue and the linked Slack thread, then define a minimal HTTP server that serves a file. Compare 4-, 2-, and 8-vCPU machines while increasing load until the four-thread pool reaches a documented threshold; done means the measurements show whether changing UV_THREADPOOL_SIZE improves behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, shell
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100