A
A
Alexander Wolf2016-06-22 11:27:05
Node.js
Alexander Wolf, 2016-06-22 11:27:05

What is the best way to run nodejs on prod?

Good day, colleagues! At the moment we have 4 single core servers, each running a node.
However, this is not very convenient. We began to look closely at pm2, but the problem arose of a rapid increase in workflows. If now we can deliver the necessary servers and run docker there, then what to do with pm2? After all, to increase the number of cores / RAM / railway, you need to restart the server. How can this be done with one server?
You can, of course, install nginx / haproxy / etc, raise a server with 4 cores now, run pm2 in it, and how will you need to raise another server and add it to the balancer, but then what is the use of the fact that we use multi-core processors?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
U
un1t, 2016-06-27
@mannaro

You can climb to a hosting that allows you to change the number of cores without rebooting (for example, caravan.ru - "Cloud infrastructure")

K
komarevtsev, 2016-06-22
@komarevtsev

Толк, в том что необходимо следить за в 4 раза меньшим количеством серверов. ну и один 4-х ядерный выйдет всегда дешевле 4-х одноядерных

S
strcpy, 2016-06-30
@strcpy

А зачем вам 4 процесса node? JS не справляется асинхронно? Посмотрите на флаг NODE_ENV — на продакшене должно быть особое значение, иначе в express есть оверхед на мелкие объекты.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question