What’s the Best Way to Determine the Right Number of Node.js Instances?

0
6
Asked By CuriousCoder99 On

I'm running a NestJS app on a VPS server along with a PostgreSQL database. I want to use cluster mode for my NestJS app to fully harness my CPU power. However, I've read that the recommended number of Node.js instances should match the number of CPU cores. Given that most of my workload is database-heavy, I'm unsure if that's the best approach. Are there ways to monitor the workload between my NestJS app and the database?

1 Answer

Answered By TechSavvyGuru On

To figure out the optimal number of Node.js instances, consider running stress tests. This helps gauge how your application and database perform under load, which is crucial especially if you're planning to sell server-side software. Monitoring your resources as you conduct these tests is key.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.