CPU core
One independent processing unit inside a CPU; a CPU with eight cores can run eight threads at literally the same time.
In more detail
A single Node.js process runs your JavaScript on one core. os.availableParallelism() reports how many cores the process can use, which is a sensible upper limit for worker pools and cluster workers.
Related terms
- CPU — The chip in a computer that runs program instructions; a machine can have several.
- parallelism — Doing several pieces of work at the same time instead of one after another.
- thread pool — A fixed or bounded set of reusable worker threads that take tasks from a queue, instead of creating a new thread for each task.
- cluster module — The Node.js module that starts several copies of a server as worker processes sharing one port, so a machine's CPU cores can all serve requests.
Taught in
- Child Processes: spawn, execFile, fork & IPC — Node.js Internals & Backend Services
- Thread Pooling: Piscina & CPU-Bound Workload Pools — Node.js Internals & Backend Services
- Cluster Architecture: node:cluster & Zero-Downtime — Node.js Internals & Backend Services