When is NodeJS Single-Threaded and when is it Multi-Threaded?
Node JS Is single threaded asynchronous non-blocking javascript runtime, but its 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 main Loop 0:00 single thread, that really just loops for callbacks
* 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)
Resources
https://nodejs.org/en/docs/guides/dont-block-the-event-loop/
http://docs.libuv.org/en/v1.x/index.html
🎙️Listen to the Backend Engineering Podcast
https://husseinnasser.com/podcast
🏭 Backend Engineering Videos
https://backend.husseinnasser.com
💾 Database Engineering Videos
https://www.youtube.com/playlist?list=PLQnljOFTspQXjD0HOzN7P2tgzu7scWpl2
🏰 Load Balancing and Proxies Videos
https://www.youtube.com/playlist?list=PLQnljOFTspQVMeBmWI2AhxULWEeo7AaMC
🏛️ Software Archtiecture Videos
https://www.youtube.com/playlist?list=PLQnljOFTspQXNP6mQchJVP3S-3oKGEuw9
📩 Messaging Systems
https://www.youtube.com/playlist?list=PLQnljOFTspQVcumYRWE2w9kVxxIXy_AMo
Become a Member
https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join
Support me on PayPal
https://bit.ly/33ENps4
Stay Awesome,
Hussein
Видео When is NodeJS Single-Threaded and when is it Multi-Threaded? канала Hussein Nasser
* Event main Loop 0:00 single thread, that really just loops for callbacks
* 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)
Resources
https://nodejs.org/en/docs/guides/dont-block-the-event-loop/
http://docs.libuv.org/en/v1.x/index.html
🎙️Listen to the Backend Engineering Podcast
https://husseinnasser.com/podcast
🏭 Backend Engineering Videos
https://backend.husseinnasser.com
💾 Database Engineering Videos
https://www.youtube.com/playlist?list=PLQnljOFTspQXjD0HOzN7P2tgzu7scWpl2
🏰 Load Balancing and Proxies Videos
https://www.youtube.com/playlist?list=PLQnljOFTspQVMeBmWI2AhxULWEeo7AaMC
🏛️ Software Archtiecture Videos
https://www.youtube.com/playlist?list=PLQnljOFTspQXNP6mQchJVP3S-3oKGEuw9
📩 Messaging Systems
https://www.youtube.com/playlist?list=PLQnljOFTspQVcumYRWE2w9kVxxIXy_AMo
Become a Member
https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join
Support me on PayPal
https://bit.ly/33ENps4
Stay Awesome,
Hussein
Видео When is NodeJS Single-Threaded and when is it Multi-Threaded? канала Hussein Nasser
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![What the heck is the event loop anyway? | Philip Roberts | JSConf EU](https://i.ytimg.com/vi/8aGhZQkoFbQ/default.jpg)
![Asynchronous vs Multithreading and Multiprocessing Programming (The Main Difference)](https://i.ytimg.com/vi/0vFgKr5bjWI/default.jpg)
![How Node JS Works?](https://i.ytimg.com/vi/YSyFSnisip0/default.jpg)
![](https://i.ytimg.com/vi/T5fGvtiqUi8/default.jpg)
![I ask this question to every Backend Engineer I interview](https://i.ytimg.com/vi/bDIB2eIzIC8/default.jpg)
![Tech I want to explore in 2022](https://i.ytimg.com/vi/k13LpTPdxt4/default.jpg)
![The Node.js Event Loop: Not So Single Threaded](https://i.ytimg.com/vi/zphcsoSJMvM/default.jpg)
![Slack's Migrating Millions of Websockets from HAProxy to Envoy, lets discuss](https://i.ytimg.com/vi/douKdQRgDEQ/default.jpg)
![CLUSTER MULTI THREADED NODEJS -- Run threads in parallel to speed up long processes (CORRECTED)](https://i.ytimg.com/vi/hXb95jm-kk0/default.jpg)
![Here's Why Node JS is NOT Single Threaded](https://i.ytimg.com/vi/JwSEqEalg7E/default.jpg)
![Multi-tenancy architecture | The Backend Engineering Show](https://i.ytimg.com/vi/IhrBgoVIoT4/default.jpg)
![WebSockets Crash Course - Handshake, Use-cases, Pros & Cons and more](https://i.ytimg.com/vi/2Nt-ZrNP22A/default.jpg)
![Introduction to libuv: What's a Unicorn Velociraptor? - Colin Ihrig, Joyent](https://i.ytimg.com/vi/_c51fcXRLGw/default.jpg)
![Managing Multiple Threads In Node JS 🧵 | OPTIMIZING NODE JS](https://i.ytimg.com/vi/W0go0ve1XE0/default.jpg)
![How Twitch Live Streaming and Chat works through HTTP - Devtooling Twitch](https://i.ytimg.com/vi/X7AQ_f-ki3s/default.jpg)
![NodeJs Interview | NodeJs Interview Questions | NodeJs Questions](https://i.ytimg.com/vi/Z1fYAMXoX9E/default.jpg)
![Is async / await useless?](https://i.ytimg.com/vi/ho5PnBOoacw/default.jpg)
![what is a database index?](https://i.ytimg.com/vi/Jemuod4wKWo/default.jpg)
![Is there a Limit to Number of Connections a Backend can handle?](https://i.ytimg.com/vi/o-EkdZW4zbA/default.jpg)
![Building a non-blocking multi-processes Web Server (Node JS fork example)](https://i.ytimg.com/vi/hmTl5Y4ee_Y/default.jpg)