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

--- Support this podcast: https://anchor.fm/hnasr/support
Up next
Jun 13
kTLS - Kernel level TLS
Fundamentals of Operating Systems Course https://oscourse.winktls is brilliant.TLS encryption/decryption often happens in userland. While TCP lives in the kernel. With ktls, userland can hand the keys to the kernel and the kernel does crypto. When calling write, the kernel encryp ... Show More
22m 55s
May 9
The beauty of the CPU
If you are bored of contemporary topics of AI and need a breather, I invite you to join me to explore a mundane, fundamental and earthy topic.The CPU.A reading of my substack article https://hnasr.substack.com/p/the-beauty-of-the-cpu 
9m 38s
Apr 18
Sequential Scans in Postgres just got faster
This new PostgreSQL 17 feature is game changer. They know can combine IOs when performing sequential scan. Grab my database coursehttps://courses.husseinnasser.com 
27m 36s
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 Async ... Show More
54m 31s
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 com ... Show More
22m 53s
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 Welcom ... Show More
22m 1s
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 you b ... Show More
20m 39s
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 involvement in ... 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:41 Bro ... Show More
21m 6s
Feb 2024
#449: Building UIs in Python with FastUI
See the full show notes for this episode on the website at talkpython.fm/449 
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. Discuss on Changelog News Changelog++ members support our work, get closer to the metal, and make the ads disappear. Joi ... Show More
54m 51s