The Backend Engineering Show with Hussein Nasser

When is NodeJS Single Threaded and when is it multi-Threaded?


Listen Later

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

          ...more
          View all episodesView all episodes
          Download on the App Store

          The Backend Engineering Show with Hussein NasserBy Hussein Nasser

          • 4.9
          • 4.9
          • 4.9
          • 4.9
          • 4.9

          4.9

          40 ratings


          More shows like The Backend Engineering Show with Hussein Nasser

          View all
          Freakonomics Radio by Freakonomics Radio + Stitcher

          Freakonomics Radio

          32,100 Listeners

          Software Engineering Radio - the podcast for professional software developers by team@se-radio.net (SE-Radio Team)

          Software Engineering Radio - the podcast for professional software developers

          275 Listeners

          Risky Business by Risky Business Media

          Risky Business

          375 Listeners

          Science Vs by Spotify Studios

          Science Vs

          12,237 Listeners

          Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

          Syntax - Tasty Web Development Treats

          982 Listeners

          Darknet Diaries by Jack Rhysider

          Darknet Diaries

          8,051 Listeners

          Practical AI by Practical AI LLC

          Practical AI

          208 Listeners

          Within Reason by Alex J O'Connor

          Within Reason

          1,645 Listeners

          All-In with Chamath, Jason, Sacks & Friedberg by All-In Podcast, LLC

          All-In with Chamath, Jason, Sacks & Friedberg

          10,182 Listeners

          Dwarkesh Podcast by Dwarkesh Patel

          Dwarkesh Podcast

          576 Listeners

          Big Technology Podcast by Alex Kantrowitz

          Big Technology Podcast

          508 Listeners

          Hard Fork by The New York Times

          Hard Fork

          5,530 Listeners

          The AI Daily Brief: Artificial Intelligence News and Analysis by Nathaniel Whittemore

          The AI Daily Brief: Artificial Intelligence News and Analysis

          682 Listeners

          Prof G Markets by Vox Media Podcast Network

          Prof G Markets

          1,489 Listeners

          The Pragmatic Engineer by Gergely Orosz

          The Pragmatic Engineer

          74 Listeners