4 ms·
Most likely answer: the application is small and there's no need, and no useful way, to extract value many cores or a lot of memory. So don't waste effort on so
by HelloNurse 5y ago
Most likely answer: the application is small and there's no need, and no useful way, to extract value many cores or a lot of memory. So don't waste effort on something that isn't needed.
Boring answer: use a pool of threads (or subprocesses, like Apache) to deal with web requests. Without stupid locking, many concurrent requests can be handled for each core. If you don't know your QoS targets, how many threads you need to meet them, and how much memory each thread requires it's a serious red flag.
Pragmatic answer: do you want to invest in fault tolerance and being able to upgrade your application? Then you need a load balancer to route traffic to multiple instances and switch them on and off properly, and a good load balancer is going to be outside your VM and probably a specific piece of hardware, irrespective of clever techniques in your application.