Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
event loop vs worker-threads for web crawler in nodejs

I'm trying to build a web crawler with NodeJS. I'm debating what is the most efficient way to implement the crawler for scale and high number of requests.

Let assume that we only send 1 request to crawl a webpage and all the URLs inside it, and repeat the process until X depth or Y URLs crawled.

I came up with 2 design options (worker-threads vs event loop):

  1. A queue containing the URLs. For each URL in the queue I create a worker-thread (from a pool) to run the crawl task and each time I see a link it will be added to the queue.

  2. Use the native event loop, so that for each URL in the HTML page I'll run the same asynchronous function in a recursive way

I'm also planning on reading the HTML pages as a stream. Which is better in terms of performance?

I'll also like to know if each worker-thread has its own event loop.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!