Good read, but despite being a major proponent of Node.js and many of the ideals it seeks to embrace, I'm not sure I'm comfortable with calling Apache "archaic". It's not like IE6, which has objectively no redeeming value as a modern platform target -- it did back in the day for sure, and is still relevant in some spheres, but overall I don't think anyone (even Microsoft) would argue that IE6 is "archaic".<p>But to call Apache, one of the most popular and successful <i>actively developed</i> webservers _archaic_? I think that's a bit much. It's not inherently <i>bad</i> just because it's not really targeting the C10K problem... just different.<p>[A minor nitpick to be sure, but it bothered me nonetheless as I feel like I'm seeing this "Threads bad. Async good." rhetoric passed around as fact all over the place and it's starting to feel a bit like Animal Farm ;)]
For the tl;dr people:<p>On the nginx side, author discusses tweaking sysctl.conf, cutting down the number of sockets stuck in TIME_WAIT, some other tweaks for performance resulting in a 90% reduction in occupied sockets. On the node.js side, author uses the cluster module to fully utilize available CPU cores, arriving at N-1 for the magic number of node processes to spawn, where N is the # of CPU cores.<p>Definitely suggested reading for anyone running Nginx + Node.js
have you tried making nodejs listen on a unix socket <a href="http://nodejs.org/docs/v0.5.4/api/net.html#socket.connect" rel="nofollow">http://nodejs.org/docs/v0.5.4/api/net.html#socket.connect</a> and then set your proxy upstreams in nginx to use that?<p>edit:<p>scratch that, it seems you're using node on cluster of servers (not on same box as nginx). In which case the article is good advice.
should nginx be only used for serving static files. Does it have any advantage when used to serve plain data API. I want to expose REST api (django + uwsgi) over web, but not sure if should use nginx for it.