UV_THREADPOOL_SIZE

An environment variable that sets how many threads libuv's thread pool has; the default is 4 and the maximum is 1024.

In more detail

It must be set before the pool is first used, so it is normally given on the command line, as in UV_THREADPOOL_SIZE=8 node app.js. More threads help when many file, DNS or crypto jobs run at once, but each uses memory, and more threads than CPU cores rarely speeds up CPU-heavy work.

Related terms

Taught in

References