3 ms·
assuming your code doesn't actually need to be multithreaded, but you want to take advantage of multicore: 1) you can use a launcher like pm2 to auto-fork your
by novaleaf 7y ago
assuming your code doesn't actually need to be multithreaded, but you want to take advantage of multicore:
1) you can use a launcher like pm2 to auto-fork your node app
2) you can horizontally scale (put your servers behind a load-balancer)
if you do need multithreading for computations, you are right that node probably isn't a very good choice, but you have some options:
1) use worker threads
2) offload your intensive computations to a separate process written in a different language.
- zaarn 7y agoEven without multithreading, Rust will soon regain advantages with Async being stabilized. You get the best of both worlds.
- rhinoceraptor 7y agoIt's also a lot harder to write, and in most cases developer time costs a lot more than another instance or two.
- zaarn 7y agoIt's not that much harder to write if you use modern practises and languages.