DEV Community

0 seconds of 15 minutes, 28 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
15:28
 
JavaScript Joel
JavaScript Joel

Posted on

5 2

CLUSTER MULTI THREADED NODEJS -- Run threads in parallel to speed up long processes

My JavaScript that creates thumbnails for hundreds of files is taking too long. So I have decided to speed things up with cluster.fork() that is built into Node.js. This will allow the workload to be spread out across my multi-core processor system.

⚠ 8:53 should read: index % forks === cluster.worker.id - 1

To follow along, you can fork this repository. I have added a tag you can check out that will bring you right to the point this video was created.

git checkout https://github.com/joelnet/mojo-gallery.git
cd mojo-gallery
git checkout youtube-video-cluster
Enter fullscreen mode Exit fullscreen mode

More Minute JavaScript Videos:

Screenshot of YouTube Channel

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

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

Okay