I wrote a Node.js application, I am looking to run it on one of our production machines. This seems like a fairly common request, but I cannot find an adequate solution. Are Node.js application deployment solutions installed?
The application is simple (<100 LOC), but it must be very efficient, reliable and can run continuously for many years without restarting. It will be launched on a large site with dozens of connections per second. (the application is not used as a web server, it only has a JSON API)
Here are the approaches that I reviewed, but I'm still not sure:
Using a framework (e.g. Express)
Since the application has to be high-performance and so simple, adding a frame-shaped bloat is what I want to avoid.
Starting a server using nohup
The main problem here is handling exceptions, we (obviously) do not want the whole server to crash due to an exception. As far as I understand, wrapping the entire application in a try {} catch {} loop will not help, because the Javascript interpreter remains in an unpredictable state after an exception. It is right?
Using something like Forever
I installed Forever on a FreeBSD machine and it was very bad. This led to the emergence of endless processes that could not be killed with Forever. I had to run kill -9 to get my machine back, and I'm not too sure about launching a production Forever application. It also seems that Upstart (a similar tool, but more general) will not work on FreeBSD.
Solution hosting (e.g. Heroku, Rackspace, Amazon EC2, etc.)
This is probably the easiest solution, but we already have serious equipment for the rest of our web servers. For financial reasons this does not make sense.
Is there really a definite solution? Did I miss something?