Keeping node.js servers up forever
11–20 of 41 posts
Re: Keeping node.js servers up forever
#12By using the 'http' module we can run a stand-alone web server in node.js without the need for a separate server like Apache or nginx. Last I checked Ryan was saying this was a very bad idea. Has that changed? It's certainly enticing.
When did you last check with him? I've been running w/o a separate server (effectively) for ~3 months.
Re: Keeping node.js servers up forever
#13This reminds me of the bad old days of Rails, when every man and his dog had some random hacky and myopic solution to keep Rails and Mongrel running. Just say no to Node/Rails/whatever specific-stuff, kids--use system level tools for running processes. Edit: removed references to "proprietary", as indexzero is correct about meaning of that.
http://linux.die.net/man/3/execvp
I haven't dug through the source for tools like monit, daemontools, but I'm sure near the metal they're using POSIX or similar system APIs.
EDIT: There's really no reason Forever has to be node specific, I actually say that in the article:
"Honestly, it's a one line fix here (https://github.com/indexzero/forever/blob/master/lib/forever...), but I'm not sure if users want to put 'node' in-front of every command."
I'll file your comment as a +1 for that feature ;)
Re: Keeping node.js servers up forever
#14I just have to wonder - after listing all those projects which already do this job and do it well... Why create / use `forever` which didn't get the same exposure to the production environments yet?
We can extend our process monitor with functionality that would be difficult to implement in those other tools.
Re: Keeping node.js servers up forever
#15I just have to wonder - after listing all those projects which already do this job and do it well... Why create / use `forever` which didn't get the same exposure to the production environments yet?
Well, we can call native node.js code from our process monitor now. We can extend our process monitor with functionality that would be difficult to implement in those other tools.
Re: Keeping node.js servers up forever
#16I just have to wonder - after listing all those projects which already do this job and do it well... Why create / use `forever` which didn't get the same exposure to the production environments yet?
Well, we can call native node.js code from our process monitor now. We can extend our process monitor with functionality that would be difficult to implement in those other tools.
Would you consider that a valid concern of process monitoring?
Planned features to Forever include this from the command line, but if you use it from node directly one could implement that feature now:
Re: Keeping node.js servers up forever
#17Re: Keeping node.js servers up forever
#18Earlier quoted context omitted.
Well, we can call native node.js code from our process monitor now. We can extend our process monitor with functionality that would be difficult to implement in those other tools.
Any examples of when this would be desirable? Seems to me that monitoring and running tools should just, you know, monitor and run things. Separation of concerns.
I'd much rather have access to a well structured library (node.js) where sockets and http are first class citizens, opposed to being forced into a solution or having to write C or bash.
Re: Keeping node.js servers up forever
#19Earlier quoted context omitted.
Well, we can call native node.js code from our process monitor now. We can extend our process monitor with functionality that would be difficult to implement in those other tools.
@intranation Just to toss out a scenario: Lets say under high traffic your application hits an edge case and starts to crash very frequently. Suppose you want to receive an email, SMS, or IM when something like this happens as a devops person. Would you consider that a valid concern of process monitoring? Planned features to Forever include this from the command line, but if you use it from node directly one could im…
Re: Keeping node.js servers up forever
#20It's good to have a system like this in place, but it should be used as an insurance policy against unknown bugs, not as a way to work around known and reproducible ones.