nodejs / nodejs/performance

Set UV_THREADPOOL_SIZE dinamically on startup

Open
#193 1 comment 3 reactions 0 assignees View on GitHub

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:

  1. Benchmark a different set of machines
  • 4vCPUs
  • 2vCPUs
  • 8vCPUs
  1. Define a minimal HTTP server that serves a file
  2. Provide load on it until 4 threads become saturated (define the threshold)
  3. Bump UV_THREADPOOL_SIZE and see how it behaves.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.