
When is NodeJS Single Threaded and when is it multi-Threaded?
About this episode
Node JS Is single-threaded asynchronous non-blocking javascript runtime, but it's not always single-threaded there are occasions where nodejs uses multi-threading, so the questions we will try to answer in this video, when is nodejs single-threaded and when does it use multi-threading and how will that affect my app?
- Event Loop single thread, that really just loops for callbacks 0:00
- Threading in Node jS (libuv) 4:00
- used for
- IO/intensive
- DNS queries
- file system reads
- CPU intensive
- crypto
- compression
- process.env.UV_THREADPOOL_SIZE=1
Examples 8:00
Cluster Nodejs 16:00
Example 1
HTTP server return 1
HTTP server while 1
HTTP server with file system read async
HTTP server with file system read sync
HTTP server with fetch call to server (dns)
Support my work on PayPal
Become a Member on YouTube
https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join
🧑🏫 Courses I Teach
https://husseinnasser.com/courses
Get every episode summarized
Each time The Backend Engineering Show with Hussein Nasser publishes, we email you a written briefing from the transcript — the topics, who appeared, and any specific claims, with the ad reads skipped.
Email me new episodesFree for 3 shows. No card needed.
Hosts & guests
No transcript yet
This episode has not been transcribed. Request it and it moves to the front of the queue.
More episodes
More from The Backend Engineering Show with Hussein Nasser

Caching is a cop-out
The Backend Engineering Show with Hussein Nasser

How open ai agents "hacked" hugging face
The Backend Engineering Show with Hussein Nasser

How a query optimization gave birth to infinite scroll
The Backend Engineering Show with Hussein Nasser

Postgres is half as fast in Linux 7.0
The Backend Engineering Show with Hussein Nasser