3

I am a node newbie. I have 3 node applications (each serves different protocols, one of them is web) that should run in an embedded device with limited memory, say 256M. I assume starting 3 node instances would start 3 isolated V8. Should I use the npm pakages "concurrently" or "npm-run-all" to start the 3 apps concurrently? As I understood this approach will start a single V8, is it right? And how is the performance (response time of the 3 apps) comparing with running 3 apps seperately? It would take some tests... but first I would like to learn it from the analytical aspect.

Mako
  • 123
  • 9
  • Hi, have you had the change to take a lookt at PM2? It basically manages the execution of Nodejs applications, including spawning multiple instances of the same app without any modification of the source code. https://pm2.keymetrics.io/docs/usage/cluster-mode/ – Firmino Changani Feb 13 '21 at 16:11
  • Firmino Changani, thanks for the recommendation. I guess PM2 goes into the same group with "concurrently" and "npm-run-all" regarding starting multiple node apps parallely. The question is resource usage and performance (three V8 instances versus one V8 instance). – Mako Feb 14 '21 at 14:25
  • Hi Mako, Regarding how many three vs one, it all depends on the load your service will receive, and the type of operations it will perform. Knowing that Node applications use only one thread of the CPU, and knowing that your service may be executing some sort of long-running operation, you may want to add mores instances of the service running concurrently. Despite that, you would also want to make sure that your service doesn't have code that blocking operations. – Firmino Changani Feb 14 '21 at 16:26
  • Thanks again for the comment. I thought the solution provided by concurrently, npm-run-all or pm2 would start 3 threads for 3 apps just like starting them seperately. And the only difference is the number of V8 instances. But I could not find info to check this guess. – Mako Feb 15 '21 at 02:12

0 Answers0