[ANN] Mongrel HTTP Server 0.1.2 (With Camping Tepee Sample)

== Mongrel 0.1.2

Mongrel is a fast as hell web server library written in (partly) Ruby. It is intended to be just enough HTTP 1.1 server to service requests for any Ruby web application. It already has an example of using Camping with more to come (see example/tepee.rb).

You can read a quick RDoc dump of Mongrel at:

  http://www.zedshaw.com/projects/mongrel/

And you can grab 0.1.2 .tar.gz and .gem files at:

  http://www.zedshaw.com/downloads/mongrel/

== Status

Mongrel is still nowhere near ready for prime time full stable usage, but it can handle a ton of requests and is blazing fast. Well, it's fast on my stuff and seems to beat WEBrick for most tasks. I'll leave it to others to use httperf or apachebench (NOT siege please!) to compare it on their setups. If you find WEBrick beating Mongrel then let me know your mix so I can fix that.

The 0.1.2 release sports a nifty fresh all C URIClassifier that's a hell of a lot faster. This has made things very quick and could become the basis for an incredibly good caching mechanism in the future. For now though it's just one more piece in the puzzle. The new URIClassifier uses http://www.octavian.org/cs/software.html for it's internal data structure.

This release also will probably have stability issues for folks on OSX (and possibly other) systems. I've removed most uses of Threads within Mongrel as a test to see if it still performs well. Even removing threads doesn't help much with OSX as there are still crashes when running the examples/tepee.rb Camping application. Linux works great so I'd like to see if other folks get crashes and such.

The next release of Mongrel will improve stability and clean up the final piece of the puzzle: IO handling. Right now the IO is just enough to make Mongrel useful. Suggestions on what the HttpResponse class should support are more than welcome. Also interested in people's thoughts on file uploading and caching.

== Examples

Since I know none of you will *ever* read the docs first, here's a simple example:

   require 'mongrel'

   server = Mongrel::HttpServer.new("0.0.0.0", 3000)
   server.register("/stuff", Mongrel::Error404Handler.new("GO AWAY!"))
   server.run.join

This will service any /stuff requests with "GO AWAY!" and a 404. Writing a service handler is pretty easy, but you gotta write your own raw HTTP response. That will improve soon.

There's also an example Camping application in examples/tepee.rb which was given to me by technoweenie.

== RubyForge

I've requested a RubyForge project for Mongrel, something I haven't done in the past. We'll see how it goes.

== It's ALPHA Geek

Remember, this is totally ALPHA work. Don't run a nuclear reactor with it, but do shoot me crashes, bug reports, anything. Especially when running examples/tepee.rb with lots of connections. This file will bomb hard when overloaded on OSX but not Linux. I'd like testing on other platforms if possible.

== Thanks

Special thanks to all the folks who have tested it out so far, and especially why for writing Camping. It's a good first test of running a "real" framework under Mongrel. Also thanks to technoweenie for giving me a first cut of tepee.rb to work with.

If I missed anyone then I'll catch you on the next release (which will probably be tomorrow as people find bugs).

Zed A. Shaw
http://www.zedshaw.com/

Hi Zed,

I got a nice improvement on Cygwin:

$ ab -n 10000 http://127.0.0.1:3000/simpletest
Requests per second: 765.55 [#/sec] (mean)

Before it was always < 600.

But, if I run a concurrency level of 10 it totally breaks in. I don't know if this is Cygwin (I suspect it is).

$ ab -n 1000 -c 10 http://127.0.0.1:3000/simpletest
Requests per second: 16.36 [#/sec] (mean)

Actually, it starts breaking in at -c 6.

-Sascha

Hi Zed,

I got a nice improvement on Cygwin:

$ ab -n 10000 http://127.0.0.1:3000/simpletest
Requests per second: 765.55 [#/sec] (mean)

Before it was always < 600.

That's cool. Seems to not crash on cygwin. So far OSX is the odd one out.

But, if I run a concurrency level of 10 it totally breaks in. I don't know if this is Cygwin (I suspect it is).

$ ab -n 1000 -c 10 http://127.0.0.1:3000/simpletest
Requests per second: 16.36 [#/sec] (mean)

Yes, this is the result of me removing the threads. It's using just a while loop to handle the requests, so it's interesting that it even does that good. :slight_smile:

I removed the threaded IO processing for now so I could get some testing on other platforms in order to compare with OSX and the stability problems I've got there. Rest assured the threads or something similar will come back with a vengeance.

Zed A. Shaw

···

On Jan 26, 2006, at 6:59 AM, Sascha Ebach wrote: