Building A Node.js Server That Won't Melt
hacks.mozilla.org
Building A Node.js Server That Won't Melt
1–10 of 49 posts
Re: Building A Node.js Server That Won't Melt
#2Re: Building A Node.js Server That Won't Melt
#3Why you would do this, instead of putting your node server behind a more battle tested proxy, like Varnish or HAProxy, and limiting the number of simultaneous connections.
Re: Building A Node.js Server That Won't Melt
#4Why you would do this, instead of putting your node server behind a more battle tested proxy, like Varnish or HAProxy, and limiting the number of simultaneous connections.
But agree that a higher level proxy is useful - because this way your overloaded application doesn't even need to deal with traffic (we hope to use toobusy to have applications instruct the routing layer to temporarily block / reroute traffic in times of load).
Re: Building A Node.js Server That Won't Melt
#5 // check if we're toobusy() - note, this call is extremely fast, and returns
// state that is calculated asynchronously.
if (toobusy()) res.send(503, "I'm busy right now, sorry.");
Saying it is calculated "asynchronously" seems pretty confusing in this context. Maybe "is cached at a fixed interval"?Re: Building A Node.js Server That Won't Melt
#6Why you would do this, instead of putting your node server behind a more battle tested proxy, like Varnish or HAProxy, and limiting the number of simultaneous connections.
npm install toobusy
then somewhere in your project require("toobusy");
If you only need one server that's going to be up to a lot faster than putting anything in front of it.Re: Building A Node.js Server That Won't Melt
#7Why you would do this, instead of putting your node server behind a more battle tested proxy, like Varnish or HAProxy, and limiting the number of simultaneous connections.
Re: Building A Node.js Server That Won't Melt
#8// check if we're toobusy() - note, this call is extremely fast, and returns // state that is calculated asynchronously. if (toobusy()) res.send(503, "I'm busy right now, sorry."); Saying it is calculated "asynchronously" seems pretty confusing in this context. Maybe "is cached at a fixed interval"?
Re: Building A Node.js Server That Won't Melt
#9Why you would do this, instead of putting your node server behind a more battle tested proxy, like Varnish or HAProxy, and limiting the number of simultaneous connections.
Our problem is the the number of simultaneous connections we can support isn't static, it varies depending on the type of traffic bursts (i.e. New vs. Returning users). But agree that a higher level proxy is useful - because this way your overloaded application doesn't even need to deal with traffic (we hope to use toobusy to have applications instruct the routing layer to temporarily block / reroute traffic in times…
Re: Building A Node.js Server That Won't Melt
#10Why you would do this, instead of putting your node server behind a more battle tested proxy, like Varnish or HAProxy, and limiting the number of simultaneous connections.
Read up on Netflix's architecture, where they've talked about this a lot. And the book "Release It!: Design and Deploy Production-Ready Software" (Nygard), though Java-oriented in its examples, covers the concepts well.