How would you figure out how many instances a Node service actually needs? And when do you add instances versus just making the code faster?
A strong answer builds capacity from measured per-core throughput and makes the scale-out versus optimize call from where the bottleneck actually sits
Start by measuring what one instance can handle. A Node process runs your JavaScript on one thread, so one process uses roughly one CPU core for request work, and on a multi-core machine you run several processes with the cluster module, or several containers, to cover all the cores. Then you load test one instance to find how many requests per second it sustains inside your latency target. Divide expected peak traffic by that number, add some safety margin, and that's your instance count. You monitor CPU, event-loop lag, and latency so you know when you're near capacity. Whether to scale out or optimize depends on the bottleneck, I'd say. If CPU is spread across lots of requests, more instances help. If it's a single slow function or a blocked event loop, fixing the code is better. And scaling out costs money continuously while optimizing is a one-time effort, so you weigh those.