logo
episode-header-image
Mar 2021
9m 6s

When is NodeJS Single Threaded and when ...

Hussein Nasser
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

https://bit.ly/33ENps4

Become a Member on YouTube

https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join

🧑‍🏫 Courses I Teach

https://husseinnasser.com/courses

Up next
Nov 24
CPU and Kernel Page Faults
<p>Page faults occurs when the process tries to access a memory that isn’t backed by a physical page kernel raises a fault which loads a page. It happens on first access, stack expansion, COW, swap and much more. However it comes with a cost. </p><p><br /></p><p>In this episode o ... Show More
48m 37s
Oct 31
Amazon US-EAST-1 Outage in Details
On October 19 2025 AWS experienced an outage that lasted over a day, 10 days later we finally got the root cause analysis and we know exactly what caused the DNS to fail0:00 Summary 5:30 How did Dynamo lost its DNS?13:41 EC2 Errors 16:16 Network Load Balancer ErrorsRCA here https ... Show More
24m 26s
Oct 17
Graceful shutdown in HTTP
There are cases where the backend may need to close the connection to prevent unexpected situations, prevent bad actors or simply just free up resources. Closing a connection gracefully allows clients and backends to clean up and finish any pending requests. In this episode of th ... Show More
25m 49s
Recommended Episodes
Jan 2018
Async + Await
Freshbooks — Sponsor If you are a small business or freelancer check out Freshbooks.com Cloud Accountingand get 30 days free. Make sure to enter SYNTAX into the "How did you hear about us" section. Show Notes 02:55 Wes' Async + Await talk on YouTube from DotJS JavaScript is A ... Show More
54m 30s
Jan 2022
JS One Liners
In this Hasty Treat, Scott and Wes talk about some Javascript one liners that speed up your coding experience in one line. Sponsor - Linode Whether you’re working on a personal project or managing enterprise infrastructure, you deserve simple, affordable, and accessible cloud co ... Show More
22m 52s
May 2024
765: JS Promises Fundamentals - Part 1
In this 3-course series, Scott and Wes serve up some JavaScript Promises treats. In part 1, they unravel the concept of promises and delve into common examples of their usage, from creating and waiting on promises, to database queries and user permissions. Show Notes 00:00 Wel ... Show More
22 m
May 2024
774: Promise Flow Control, Concurrency, Libraries, TypeScript and Deferreds - Part 3
In today’s episode, Scott and Wes dive into the final part of our JavaScript Promises series, covering deferred promises, fetch, flow control, concurrency with libraries like p-map and p-limit, and integrating TypeScript. Show Notes 00:00 Welcome to Syntax! 00:31 Brought to ... Show More
20m 38s
Jan 2024
716: JS Perf Wins & New Node.js Features with Yagiz Nizipli
Yagiz Nizipli talks about his involvement with Node.js, implementing .env, how he finds areas to improve in performance, the happy path vs the hot path, and new features coming to Node.js. Show Notes 00:32 Welcome 01:01 Introducing Yagiz Nizipli 02:21 What is your involvem ... Show More
1h 1m
May 2024
771: Promises: Error Handling, Aborts, and Helper Methods - Part 2
We’re diving into part 2 of our 3-part series on Promises, focusing on error handling, aborts, and essential helper methods. We’ll explore how to manage errors effectively and improve performance with abort signals. Let’s get into it! Show Notes 00:00 Welcome to Syntax! 00:4 ... Show More
21m 5s
Feb 2024
#449: Building UIs in Python with FastUI
See the full show notes for this episode on the website at <a href="https://talkpython.fm/449">talkpython.fm/449</a> 
1h 6m
Apr 2018
The state of Node security (JS Party #23)
Suz Hinton, Christopher Hiller, and Jerod Santo talk with Adam Baldwin about his company being acquired by NPM, the security of Node, best practices, and more. 
54m 51s