3 ms·
It's not hard to install nodejs, and then you need forever or w/e to keep it running, you need that to start on boot, you need pingdom or whatever to monitor it
by benologist 13y ago
It's not hard to install nodejs, and then you need forever or w/e to keep it running, you need that to start on boot, you need pingdom or whatever to monitor it, you need your haproxy or nginx for load balancing, you need to decide what to log and how to store those files beyond megabytes, maybe you need ssl, you need a way to get the next version running, and you need to be able to fix it when stuff goes wrong.
All of those things are just distractions from whatever your project really is. Are you building software or are you dicking around with servers?
- ilaksh 13y ago99% of Node applications do not need any load balancing. 1% are Twitter or something. And even a lot of the 1% would do it at the application layer using multiple VMs. And I bet that most of the Heroku apps on Node that use multiple dynos really only need multiple dynos because Heroku's dyno isn't giving them realistic resources on the dynos, i.e. less than one small AWS or Linode or whatever. Forever will not keep your Node application running. If you Node application crashes, forever will let it crash, and then run it again, and if it crashes again, it will run it again, and it will crash again. There used to be basic gotchas in HTTP/Express that made it really easy to have an exception thrown that would take down a Node web server. I am not sure those are already there, but anyway I do what every Node expert advises against and include and uncaughtException handler in my Node web servers. That keeps them running. If I take it out, the effect is that they go down briefly, and forever restarts them. So honestly I see no benefit in most cases to using forever except to make it a little bit harder to figure out how launch your application. And the thing with automatically restarting when a server reboots, honestly my servers very rarely reboot. If they are going to reboot then the VM (VPS) provider gives me warning and lets me control it. So for 99% of applications out there, an upstart or whatever to restart your Node application really isn't that important. Contrary to popular belief, you do not need to install nginx in front of every Node application. I will give you the SSL one, that could easily take a good UI developer 2 or 3 days to find the right instructions on Google.
- benologist 13y agoYou are correct, with enough experience it will suck a smaller amount of time and attention away from your actual project. Unrelated to the core argument, I think much of what you just posted is bad advice - forever will restart your app above and beyond uncaughtException, nginx or haproxy let you add redundancy on independent processes if not machines, and restarting your site manually on reboot is ludicrous.