# Mongrel HTTP Server 0.1.2 (With Camping Tepee Sample)

**URL:** <https://www.ruby-forum.com/t/mongrel-http-server-0-1-2-with-camping-tepee-sample/97486>\
**Category:** Ruby\
**Created:** [January 26, 2006, 8:02am UTC](https://www.ruby-forum.com/t/mongrel-http-server-0-1-2-with-camping-tepee-sample/97486 "2006-01-26T08:02:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zed\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/da6949/32.png) [@Zed\_S](https://www.ruby-forum.com/u/Zed_S)\
**Post date:** [January 26, 2006, 8:02am UTC](https://www.ruby-forum.com/t/mongrel-http-server-0-1-2-with-camping-tepee-sample/97486/1 "2006-01-26T08:02:55Z")

</div>

== 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](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

> **[Zed A. shaw](https://zedshaw.com/)**
>
> Personal essays and writings by Zed A. Shaw.

---

<div class="post-metadata">

**Author:** ![Zed\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/da6949/32.png) [@Zed\_S](https://www.ruby-forum.com/u/Zed_S)\
**Post date:** [January 26, 2006, 1:01pm UTC](https://www.ruby-forum.com/t/mongrel-http-server-0-1-2-with-camping-tepee-sample/97486/2 "2006-01-26T13:01:16Z")

</div>

Hi Zed,

I got a nice improvement on Cygwin:

$ ab -n 10000 [http://127.0.0.1:3000/simpletest](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](http://127.0.0.1:3000/simpletest)  
Requests per second: 16.36 [#/sec] (mean)

Actually, it starts breaking in at -c 6.

-Sascha

---

<div class="post-metadata">

**Author:** ![Zed\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/da6949/32.png) [@Zed\_S](https://www.ruby-forum.com/u/Zed_S)\
**Post date:** [January 26, 2006, 1:13pm UTC](https://www.ruby-forum.com/t/mongrel-http-server-0-1-2-with-camping-tepee-sample/97486/3 "2006-01-26T13:13:22Z")

</div>

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

> Hi Zed,
> 
> I got a nice improvement on Cygwin:
> 
> $ ab -n 10000 [http://127.0.0.1:3000/simpletest](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](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. 🙂

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

> **[Zed A. shaw](https://zedshaw.com/)**
>
> Personal essays and writings by Zed A. Shaw.
