DEV Community

Muhammad Hasnain
Muhammad Hasnain

Posted on

NodeJS Worker Thread on EC2 Instance with single thread?

Hi!

I'm not a 100% familiar with NodeJS workers and clusters. I know that we can make use of multiple threads which is amazing to say the least.

I'm working on a small personal project that I've hosted on an free EC2 instance and I see that there is one CPU and one thread available. Is there then any benefit of using worker threads?

Also, why does the NodeJS Cluster documentation fork a cluster for a single CPU instead of a thread?

Thanks!

Top comments (2)

Collapse
 
heptalophos profile image
Chris

what happened to the React post?

Collapse
 
hasnaindev profile image

Hello! I had to remove it because I didn't made my intent clear in that post. Readers thought I was criticizing React. Thanks for inquiring though!

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay