« Currently In Rotation | Main | Social Networking Patents Don't Make Sense »
October 9, 2006
nginx
Everyone who knows me in the web scene knows that I'm a fan of the mentality "use the right tool for the job". For example: I don't particularly like php, but sometimes it makes sense to use.
All my work lately has been using Apache2+ModPerl2.
Apache does http right- its the best server in terms of compatibility and standards, but it eats ram and the performance isn't that great.
I like to offload apache by using light servers on port 80 to proxy off of.
For a while, i was advocating lighttpd as a solution. While It had some issues proxying webdav, it was workable with some creative solution.
Then bob@ MochiMedia asked me for some ideas one day. He was running pound as a reverse proxy for MochiBot, and wanted to try something lighter. I pointed him to lighty, which he had up and running in no time-- but then discovered a massive memory leak in mod proxy. We call it lighttSEIVE now.
He was looking for new ideas, and then i remembered about how I found lighty... I was searching for lightweight servers and did the standard google searches. But then I decided to be creative-- I went onto alexa and netcraft, and tried to find out what all the illicit russian servers were running ( porn / mp3 servers + rooted spam boxes ).
I figured 'hey- if they're selling stolen stuff, they're probably running on really bad hardware and needed to find software to maximize their resources. and if they're rooting a box, they probably need to be running some http server that doesn't strain the resources so they're "found" later than sooner'
I was right. most of these serevers were running something called nginx. i eventually found the docs online, but they were mostly in russian, with a smattering of engrish.
I tried to use it, and then gave up , deferring to use lighty.
Fast forward to 2006, and lighty's mod_proxy still sucks and leaks like crazy. Friends and I joke nonstop that its only fitting lighty is made by a mysql employee ( sorry Jan, you're an extremely talented guy-- and def a better coder than me. I know you only get to work on lighty in your spare time-- but your day job is at the world's worst open source rdbms , and that stigma will forever haunt your open source projects ).
Bob finds the lighty leak, is about to go back to pound , and I respond:
oh, there's this russian server nginx. all the porn sites use it. it must be decent.
Bob tried it, fell in love.
I tried it, and fell in love.
Nginx is ridiculoulsy lightweight, performs amazingly well , and has some of the best-thought-out systems and design approaches inside.
Not to mention-- out of the box, it facilitiates binding 2 instances at once to port 80, you can upgrade the binary+ config , start a new server and kill the old one ... never losing a request and never having downtime. Brilliant.
there's a great wiki on nginx over at
http://wiki.codemongers.com/Nginx
I've created an alternate 'skeleton' that may be more familiar to some users. It uses the include directive to fake macros
You can see it via svn here:
http://dev.2xlp.com/svn/nginx_config/trunk/conf/
Posted by Jonathan at October 9, 2006 10:58 PM
Trackback Pings
TrackBack URL for this entry:
http://www.destructuring.net/mt/mt-tb.cgi/4
Comments
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)