Hi,
This is an announce for Mongrel, a mostly Ruby webserver. I just
started it as I was trying to work on solutions for people deploying
Ruby web applications, and already it’s pretty damn fast. We’re
talking really really damn fast. I mean like people won’t believe me
that it’s this fast and I don’t really believe it.
INSTALL
First off, you can grab it at http://www.zedshaw.com/downloads/
mongrel-0.1.0.tar.bz2 to play with it.
*** You’ll need Ruby 1.8.4, but it’s tested on Mac OSX and Linux at
least. ***
When you get it do:
rake
ruby -Ilib examples/simpletest.rb
Go to http://localhost:3000/test to play with it. Other URIs give
you a lame “not found”.
HOW?
Feel free to look at the source in lib/mongrel.rb and if you want to
go insane you can try to grok the HTTP parser in ext/http11/*.c (not
that bad really).
CAN IT BAKE CHEDDAR?
So far it’s very light and isn’t nearly capable enough, so I’m
looking for things people want in a simple web app server for
running their Ruby web applications in. Keep in mind that I’m not
going to be Ruby on Rails specific. I love all you weirdos.
Now for the fun (and surely flamewar generating) statistics on how it
compares to WEBrick:
WEBrick/Linux: 175 req/sec
Mongrel/Linux: 1350 req/sec
WEBrick/OSX: 5.3 req/sec
Mongrel/OSX: 304.4 req/sec
– Both tests were a simple handler that sent back “hello!” when /
test was accessed. WEBrick’s logging was redirected to /dev/null
since I can’t figure out how to turn it the hell off.
The OSX results are pathetic and I suspect there’s something
seriously wrong with my setup since OSX does considerably worse than
the comparable Linux machine. But, the important thing is that
Mongrel seems to be doing way better than WEBrick. I’m hoping to
keep the high performance, but don’t trust my word for it, go grab
the source and grab httperf to see if you get similar performance on
your machines. Hell, it might even work on Win32.
DOWNSIDES
It uses some Ruby 1.8.4 stuff and it uses a C extension for the HTTP
parsing. The C is all ANSI so you should be OK, but let me know if
it don’t compile somewhere. It’s also nowhere near complete, mostly
just enough code to prove the concept.
FEEDBACK
Since I just started this, and I’m getting such great performance out
of it already, I’m looking to get it working with Rails this weekend
(along with SCGI fixes to keep people happy), then maybe Og+Nitro.
I’d love for people to send me their wish list and opinions on this.
I’m mostly motivated to write this as the answer to Java’s Tomcat.
What are your thoughts? Too ambitious? Not enough?
I’m especially interested if you can improve the performance or
disprove that it’s actually that fast. I still don’t quite believe
it myself.
Thanks for the time, and enjoy.
Zed A. Shaw