Geshan Manandhar
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:

Exploring Zed, A Newly Open Source Code Editor Written In Rust

Exploring Zed, an open source code editor written in Rust

The Zed code editor sets itself apart with its lightning-fast performance and cutting-edge collaborative features.

Nefe Emadamerho-Atori
Apr 22, 2024 ⋅ 7 min read
Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 ⋅ 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 ⋅ 7 min read
Using Aoi Js To Build A Bot For Discord

Using aoi.js to build a bot on Discord

Explore how the aoi.js library makes it easy to create Discord bots with useful functionalities for frontend applications.

Rahul Padalkar
Apr 17, 2024 ⋅ 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