2022-08-29
2359
#node
Geshan Manandhar
58619
Aug 29, 2022 ⋅ 8 min read

Optimizing your Node.js app’s performance with clustering

Geshan Manandhar Geshan is a seasoned software engineer with more than a decade of software engineering experience. He has a keen interest in REST architecture, microservices, and cloud computing. He also blogs at geshan.com.np.

Recent posts:

A guide to image overlays in CSS

Learn the basics of applying image overlays in CSS and explore more interactive techniques like hover effects and animations.

Ibadehin Mojeed
Mar 11, 2025 ⋅ 5 min read

How to use EJS to template your Node.js application

EJS makes working with templates in Node.js super easy — but only if you know how to use it. This guide walks you through the essentials and more.

Samuel Olusola
Mar 11, 2025 ⋅ 15 min read
Remote Branches In Git LogRocket

How to check out a remote branch in Git: A step-by-step guide

Learn how to list, fetch, and checkout remote Git branches, plus troubleshoot outdated branch lists effectively.

Oyinkansola Awosan
Mar 11, 2025 ⋅ 8 min read
How To Switch Node.js Versions With NVM

How to switch Node.js version: A cross-platform guide for NVM and alternatives

Use NVM, Node Version Manager, to switch between Node.js versions, simplifying your development process.

Precious Luke
Mar 10, 2025 ⋅ 9 min read
View all posts

5 Replies to "Optimizing your Node.js app’s performance with clustering"

  1. This is a really good article. I didn’t know that pm2 had cluster mode and it actually means LBing. Thank you very much.

  2. How do you create clustering to multiple EC2 instances?
    I’m looking on to run a cluster of EC2 instance with NodeJS clustering talking to a MySQL database in Master + RR

    Thanks for your thoughts in advance!

    1. Hey Ashley,

      Clustering EC2 instances will be more like load balancing and that would need the application to be stateless.

      Rather than that possibly look at AWS Fargate (or Google cloud run). Another way of doing it might be a full on Kubernetes (EKS) but that might be too much depending on the use-case. It might be easier to try out AWS Lambda and scale up to Fargate/ECS than dabble with EC2 VMs.

Leave a Reply