On Friday, November 15, 2013 11:04:57 PM UTC+4, Eric Mill wrote:
>
> On Friday, November 15, 2013 4:19:25 AM UTC-5, Alex Kocharin wrote:
>>
>>
>> On Thursday, November 14, 2013 8:22:16 PM UTC+4, Eric Mill wrote:
>>>
>>> I'm totally fine being told that the Unicorn model is the wrong way to
>>> think of things in Node. But what are the best practices
>>>
>>
>> There is no such thing called "best practice". You can ask what other
>> people do, but the best way to do something simply doesn't exist.
>>
>
> Yeah, yeah -- sometimes there are best practices. :)
>
This is nonsense. You can say that X is better than Y under a number of
conditions. But you can't say that X is best without providing an explicit
set of possibilities where X is best. It just doesn't make sense.
I can say that 3 is greater than 2. I can say that 3 is a greatest number
in a set {1,2,3}. But if I say "3 is a greatest number", I would look like
an idiot. Same thing with those "best practices".
>
> for deploying a Node app where I'd like to be able to scale the number of
>>> processes up and down easily on a box? The model I'm used to is putting
>>> nginx in front, having it proxy to a Unix socket, and then having Unicorn
>>> watch the same Unix socket.
>>>
>>> I'm aware of node-http-proxy<https://github.com/nodejitsu/node-http-proxy>
>>> -
>>> should I run one of these with
>>> forever<https://github.com/nodejitsu/forever> --
>>> and then also manage my express processes with forever? How should I be
>>> conceiving of the problem?
>>>
>>
>> I'm using nginx for reverse proxy and pm2 for a supervisor. Nginx serves
>> static files faster (node-http-proxy is good, but it more suited for other
>> uses), and pm2 works better for me for a number of reasons.
>>
>
> I spent some time last night with "forever" and pm2. pm2 proved to have an
> annoying stopping
> bug<https://github.com/Unitech/pm2/issues/42#issuecomment-21705624> that
> the author can't or won't fix, instead referring users to use the unstable
> 0.11 branch (which immediately produced crashes in my app). I was able to
> get forever working the way I wanted to, so that's what I'm going with for
> now. pm2 seems nice, and more like the future, but it's also heavy and
> seems to have a larger code surface.
>
Stopping bug is NOT a pm2 bug, but a node core bug. And node core team
won't fix it in stable branch because it involves a lot of subtle changes
in cluster module.
Anyway, it involves cluster module, and it's a feature that forever doesn't
even have. If you just want a forever-like functionality, you can use
'fork' mode, I believe it's '-x' argument there.
I used forever before, and the biggest issue with it was the fact that it
was constantly breaking on unstable, and it took months to fix every time.
Plus a nasty native dependency. Well... I guess they fixed it, so nevermind.
>
>
>> By the way yes, you would probably want to manage your processes with a
>> some kind of supervisor. It's quite usual to node processes to crash, and
>> it'll be nice to have something to restart them.
>>
>
> Yeah, unicorn's model is helpful for this. Phusion Passenger supports
> Node, but the free version only supports recompiling nginx with Passenger
> inside, an idea I hate. You can get the unicorn-like unix socket model for
> Node if you pay them money for their Enterprise version.
>
I don't know what do you mean by "unicorn model", but something tells me
that you can do the same with built-in 'cluster' module in node.
> If anyone knows of any free Node-optimized alternatives to forever and
> pm2, let me know. forever is good, but it could be better.
>
>
What exactly could be better there?
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.