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,245 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

          273 Listeners

          Risky Business by Patrick Gray

          Risky Business

          373 Listeners

          Science Vs by Spotify Studios

          Science Vs

          12,165 Listeners

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

          Syntax - Tasty Web Development Treats

          989 Listeners

          Darknet Diaries by Jack Rhysider

          Darknet Diaries

          8,110 Listeners

          Practical AI by Practical AI LLC

          Practical AI

          209 Listeners

          Within Reason by Alex J O'Connor

          Within Reason

          1,658 Listeners

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

          All-In with Chamath, Jason, Sacks & Friedberg

          10,227 Listeners

          Dwarkesh Podcast by Dwarkesh Patel

          Dwarkesh Podcast

          548 Listeners

          Big Technology Podcast by Alex Kantrowitz

          Big Technology Podcast

          513 Listeners

          Hard Fork by The New York Times

          Hard Fork

          5,547 Listeners

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

          The AI Daily Brief: Artificial Intelligence News and Analysis

          659 Listeners

          Prof G Markets by Vox Media Podcast Network

          Prof G Markets

          1,471 Listeners

          The Pragmatic Engineer by Gergely Orosz

          The Pragmatic Engineer

          74 Listeners