Mongrel Web Server 0.3.12 -- Finally Out


#1

Hello Folks,

This is the long awaited (like 2 weeks) 0.3.12 release of Mongrel. This
release has received heavier testing than previous releases and supports
a
whole raft of improvements to existing functionality plus some new
stuff.

For those not clued in, Mongrel is a web server written in (mostly)
Ruby.
Check the funny dogs and read the docs about it at
http://mongrel.rubyforge.org/. The goal is to create a Ruby HTTP server
to
compete with Apache Tomcat or other Java application servers. The other
goal is to have the speed of FastCGI with the ease of WEBrick.

WHAT’S NEW

The big points of this release are:

  • The Mongrel::Configurator and Mongrel::Rails::Configurator for simple
    configuration (mostly for framework implementers to use).
  • Dynamically loadable handlers from the GemPlugins system. Next
    release
    will let you write and add your own handlers.
  • Chained handlers. That’s right, you can stack a series of handlers on
    any
    URIs and they’ll be processed in order. This gives you an advanced and
    fast
    pipe-lined processing system and is already used to implement the
    extensive
    debugging support Mongrel has.
  • Debugging, Debugging, Debugging. Try the -B option and then look in
    the
    log/mongrel_debug logs. I’ll be beefing this up to insane usefulness
    for
    the 0.3.13 release.
  • Support for sendfile on FreeBSD, Linux, and Solaris if you install the
    ruby-sendfile (http://rubyforge.org/projects/ruby-sendfile) gem. This
    is
    experimental but already gives a 20% boost on static files.
  • Additional proper headers for static files from the DirHandler in
    order to
    allow browsers to cache the content. People using Mongrel for
    development
    or small sites will love this combined with the sendfile support.
  • Lots and lots of little tweaks to improve speed and stability.
    Mongrel is
    starting to hit a wall again with performance so I’ll be looking for new
    hot-spots to move to C in the near future.
  • Initial support for Rails 1.1. Remember if you use Typo it is broken
    not
    Mongrel
    . Typo is being frantically fixed so be patient.
  • Fix for a bad typo on Win32 that prevented people from using
    additional
    mime types files (stupid Emacs and it’s damn capitalize command being
    exactly the same as Copy in every other editor).
  • Ability to specify a timeout throttling setting and a max number of
    concurrent connections with additional attempts at cleaning dead threads
    out. Future debugging will help people spot these.
  • Lots of new Camping support and integration (thanks to Trotter Cashion
    for
    using Mongrel with Camping like crazy).
  • A handy -C option for the mongrel_rails script that lets you specify
    the
    options you’d normally do on the command line as a YAML hash. More on
    this
    later.

INSTALL

Everyone can go download 0.3.12 from
http://rubyforge.org/frs/?group_id=1306
like normal or do the usual “gem install mongrel” or “gem update” to get
the
latest and greatest.

– If you followed pre-release please uninstall first.

NEXT STOP…

The next steps with Mongrel will be to add the capability for users of
Mongrel to write their own Configurator scripts and to test the living
daylights out of it. If you missed my last announcement, Mongrel is
getting
commercial sponsorship from EastMedia (http://www.eastmedia.com/) in
partnership with VeriSign (http://www.verisign.com/) for use in a
potentially large scale project. My role in this is to make sure
Mongrel
can handle the required role and will not ever crash. I’ll be spending
the
next few weeks putting out less features and doing more stability and
speed
tweaks. Stay tuned. Should be fun.

Enjoy and report those bugs!

Zed A. Shaw
http://mongrel.rubyforge.org/


#2

On Mar 30, 2006, at 2:37 AM, Zed S. wrote:

This is the long awaited (like 2 weeks) 0.3.12 release of Mongrel.
This
release has received heavier testing than previous releases and
supports a
whole raft of improvements to existing functionality plus some new
stuff.

Minor, minor point:

Installing RDoc documentation for mongrel-0.3.12…

lib/mongrel/rails.rb:135:49: Skipping require of dynamic string: “#
{ops[:cwd]}/config/environment”

Macintosh OS X 10.4.5 (PPC) with Ruby 1.8.4


– Tom M.


#3

Hi Zed,

I read the website, but I must admit I still don’t see what benefits
Mongrel will bring me. What can it do that fcgi cannot? Is it just an
easier (and maybe faster) way to run rails apps or does it add
functionality that is currently not available?

Jeroen


#4

Hi Zed,

Thanks for the great new release!

  • Fix for a bad typo on Win32 that prevented people from using additional
    mime types files (stupid Emacs and it’s damn capitalize command being
    exactly the same as Copy in every other editor).

This now works with mongrel_rails_service but not with mongrel_rails
from the command line (I tested it on Windows2003 and OS X). If I start
Mongrel from the command line I get:

mongrel_rails start -m config/mime.yaml

** Starting Mongrel in development mode at 0.0.0.0:3000
** Loading additional MIME types from config/mime.yaml
** Loading additional MIME types from config/mime.yaml
** Starting Rails in environment development …
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no
restart).
** Rails signals registered. HUP => reload (without restart). It might
not work well.
** Running 0.0.0.0:3000 listener.
** Mongrel available at 0.0.0.0:3000

Watch the double output for the MIME-stuff.

Installing Mongrel with MIME-support as a service on Windows2003 works
now.

Regards,
Jonathan


#5

hey, first off thanks - ive been using it locally and i love it, works a
charm

im currently running lighttpd + scgi (cheers again!) and i’m eager to
give
your lighttpd + mongrel proxy setup a bash; one thing though, is
memcached a
requirement or just advised/preferred?

this is for running on a vps with 256MB, so resources are at a premium

first thing on memcached’s w3 page is a boot command specifying 2GB ram
which
is scaring the beejesus outta me to say the least… i assume i can get
away
with substantially less than this but do i need it at all in order to
utilise
lighttpd’s cache?

this is for lightweight apps using sqlite3, no fat rdbms’s

any tips before i screw my server are most welcome

cheers


#6

I’m using Lighty and Mongrel, but don’t use memcached (nor Lighty’s
cache, which I haven’t heard of (unless it’s the PFM Zed mentions in his
Lighty-Mongrel doc) ).

Joe


#7

yeah it’s the power magnet bit - i’m just not really sure if the

“Memcached
The next installment of this document will tell you how to setup a
memcached
so that you can run the lighttpd on a different server from the Mongrel
cluster. Right now they all have to reside on one machine.”

part means anything as far as cacheing using lighttpd is concerned (on
one
machine)

off to read up some more :stuck_out_tongue:

cheers


#8

Hi,

Zed S. wrote:

Enjoy and report those bugs!

Thks for this soft !

Two points, maybe bugs:

on debian unstable/powerpc:
Building native extensions. This could take a while…
http11.c: In function ?header_done?:
http11.c:95: warning: unused variable ?port?
http11.c:94: warning: unused variable ?host?
http11.c: At top level:
http11.c:25: warning: ?global_interface_value? defined but not used
ext/http11/http11_parser.c: In function ?http_parser_execute?:
ext/http11/http11_parser.c:423: warning: comparison is always true due
to limited range of data type
ext/http11/http11_parser.c:473: warning: comparison is always true due
to limited range of data type
ext/http11/http11_parser.c:491: warning: comparison is always true due
to limited range of data type
ext/http11/http11_parser.c:542: warning: comparison is always true due
to limited range of data type
ext/http11/http11_parser.c:564: warning: comparison is always true due
to limited range of data type
ruby extconf.rb update mongrel
checking for main() in -lc… yes

but seems to work well though.

on debian sarge/686 it successfully installs too, though the report
while compiling show many small errors.
But mongrel_rails start fails with
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12/lib/mongrel/rails.rb:28:
uninitialized constant Mongrel::HttpHandler (NameError).
I don’t think I miss a library :confused: Ideas ?

Compilation output, maybe useful for you:
Building native extensions. This could take a while…
Dans le fichier inclus à partir de http11.c:1:
/usr/lib/ruby/1.8/i486-linux/ruby.h:28:21: stdlib.h : Aucun fichier ou
répertoire de ce type
/usr/lib/ruby/1.8/i486-linux/ruby.h:32:21: string.h : Aucun fichier ou
répertoire de ce type
/usr/lib/ruby/1.8/i486-linux/ruby.h:42:19: stdio.h : Aucun fichier ou
répertoire de ce type
/usr/lib/ruby/1.8/i486-linux/ruby.h:64:20: alloca.h : Aucun fichier ou
répertoire de ce type
Dans le fichier inclus à partir de
/usr/lib/gcc-lib/i486-linux/3.3.5/include/syslimits.h:7,
à partir de
/usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h:11,
à partir de /usr/lib/ruby/1.8/i486-linux/ruby.h:84,
à partir de http11.c:1:
/usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h:122:75: limits.h :
Aucun fichier ou répertoire de ce type
Dans le fichier inclus à partir de
/usr/lib/ruby/1.8/i486-linux/ruby.h:677,
à partir de http11.c:1:
/usr/lib/ruby/1.8/i486-linux/missing.h:16:24: sys/time.h : Aucun fichier
ou répertoire de ce type
/usr/lib/ruby/1.8/i486-linux/missing.h:25:25: sys/types.h : Aucun
fichier ou répertoire de ce type
In file included from /usr/lib/ruby/1.8/i486-linux/ruby.h:678,
from http11.c:1:
/usr/lib/ruby/1.8/i486-linux/intern.h:215: error: erreur de syntaxe
before “fd_set”
/usr/lib/ruby/1.8/i486-linux/intern.h:216: attention : struct timeval' declared inside parameter list /usr/lib/ruby/1.8/i486-linux/intern.h:216: attention : its scope is only this definition or declaration, which is probably not what you want /usr/lib/ruby/1.8/i486-linux/intern.h:216: attention : parameter has incomplete type /usr/lib/ruby/1.8/i486-linux/intern.h:446: attention : noms de paramÃ?tres (sans type) dans la déclaration de fonction Dans le fichier inclus à partir de http11.c:1: /usr/lib/ruby/1.8/i486-linux/ruby.h:687:21: pthread.h : Aucun fichier ou répertoire de ce type In file included from http11.c:1: /usr/lib/ruby/1.8/i486-linux/ruby.h:689: error: erreur de syntaxe before "rb_nativethread_t" /usr/lib/ruby/1.8/i486-linux/ruby.h:689: attention : type defaults toint’ in declaration of rb_nativethread_t' /usr/lib/ruby/1.8/i486-linux/ruby.h:689: attention : data definition has no type or storage class http11.c:3:20: assert.h : Aucun fichier ou répertoire de ce type http11.c:4:20: string.h : Aucun fichier ou répertoire de ce type Dans le fichier inclus à partir de http11.c:5: http11_parser.h:4:23: sys/types.h : Aucun fichier ou répertoire de ce type http11.c:6:19: ctype.h : Aucun fichier ou répertoire de ce type http11.c: Dans la fonction « http_field »: http11.c:51: attention : implicit declaration of functiontoupper’
http11.c: Dans la fonction « header_done »:
http11.c:103: attention : implicit declaration of function strchr' http11.c:94: attention : unused variablehost’
http11.c:95: attention : unused variable port' http11.c: Dans la fonction « HttpParser_free »: http11.c:124: attention : implicit declaration of functionfree’
http11.c: Dans la fonction « URIClassifier_alloc »:
http11.c:289: attention : implicit declaration of function assert' http11.c: Hors de toute fonction : http11.c:25: attention :global_interface_value’ defined but not used
make: *** [http11.o] Erreur 1
Dans le fichier inclus à partir de http11.c:1:
/usr/lib/ruby/1.8/i486-linux/ruby.h:28:21: stdlib.h : Aucun fichier ou
répertoire de ce type
/usr/lib/ruby/1.8/i486-linux/ruby.h:32:21: string.h : Aucun fichier ou
répertoire de ce type
/usr/lib/ruby/1.8/i486-linux/ruby.h:42:19: stdio.h : Aucun fichier ou
répertoire de ce type
/usr/lib/ruby/1.8/i486-linux/ruby.h:64:20: alloca.h : Aucun fichier ou
répertoire de ce type
Dans le fichier inclus à partir de
/usr/lib/gcc-lib/i486-linux/3.3.5/include/syslimits.h:7,
à partir de
/usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h:11,
à partir de /usr/lib/ruby/1.8/i486-linux/ruby.h:84,
à partir de http11.c:1:
/usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h:122:75: limits.h :
Aucun fichier ou répertoire de ce type
Dans le fichier inclus à partir de
/usr/lib/ruby/1.8/i486-linux/ruby.h:677,
à partir de http11.c:1:
/usr/lib/ruby/1.8/i486-linux/missing.h:16:24: sys/time.h : Aucun fichier
ou répertoire de ce type
/usr/lib/ruby/1.8/i486-linux/missing.h:25:25: sys/types.h : Aucun
fichier ou répertoire de ce type
In file included from /usr/lib/ruby/1.8/i486-linux/ruby.h:678,
from http11.c:1:
/usr/lib/ruby/1.8/i486-linux/intern.h:215: error: erreur de syntaxe
before “fd_set”
/usr/lib/ruby/1.8/i486-linux/intern.h:216: attention : struct timeval' declared inside parameter list /usr/lib/ruby/1.8/i486-linux/intern.h:216: attention : its scope is only this definition or declaration, which is probably not what you want /usr/lib/ruby/1.8/i486-linux/intern.h:216: attention : parameter has incomplete type /usr/lib/ruby/1.8/i486-linux/intern.h:446: attention : noms de paramÃ?tres (sans type) dans la déclaration de fonction Dans le fichier inclus à partir de http11.c:1: /usr/lib/ruby/1.8/i486-linux/ruby.h:687:21: pthread.h : Aucun fichier ou répertoire de ce type In file included from http11.c:1: /usr/lib/ruby/1.8/i486-linux/ruby.h:689: error: erreur de syntaxe before "rb_nativethread_t" /usr/lib/ruby/1.8/i486-linux/ruby.h:689: attention : type defaults toint’ in declaration of rb_nativethread_t' /usr/lib/ruby/1.8/i486-linux/ruby.h:689: attention : data definition has no type or storage class http11.c:3:20: assert.h : Aucun fichier ou répertoire de ce type http11.c:4:20: string.h : Aucun fichier ou répertoire de ce type Dans le fichier inclus à partir de http11.c:5: http11_parser.h:4:23: sys/types.h : Aucun fichier ou répertoire de ce type http11.c:6:19: ctype.h : Aucun fichier ou répertoire de ce type http11.c: Dans la fonction « http_field »: http11.c:51: attention : implicit declaration of functiontoupper’
http11.c: Dans la fonction « header_done »:
http11.c:103: attention : implicit declaration of function strchr' http11.c:94: attention : unused variablehost’
http11.c:95: attention : unused variable port' http11.c: Dans la fonction « HttpParser_free »: http11.c:124: attention : implicit declaration of functionfree’
http11.c: Dans la fonction « URIClassifier_alloc »:
http11.c:289: attention : implicit declaration of function assert' http11.c: Hors de toute fonction : http11.c:25: attention :global_interface_value’ defined but not used
make: *** [http11.o] Erreur 1
ruby extconf.rb update mongrel
checking for main() in -lc… no
creating Makefile


Jean-Christophe M.

fools."
Martin Luther King, Jr.


#9

looks like i’m cool without it, sorry for the noise

must not think straight onto mailing lists


#10

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeroen H. wrote:

Hi Zed,

I read the website, but I must admit I still don’t see what benefits
Mongrel will bring me. What can it do that fcgi cannot? Is it just an
easier (and maybe faster) way to run rails apps or does it add
functionality that is currently not available?

For one, it’s a nice replacement for webrick, while developing, as it is
much
faster than webrick.

Compared to fcgi, it’s similar, so if you have a working fcgi
environment, it
may be a tougher call. Of interest to me was:

http://weblog.textdrive.com/article/200/playing-with-lighttpd-litespeed-fcgi-and-mongrel

where they said, “Mongrel as a proxy performs just as well as fcgi does,
either
with lighttpd or litespeed, and could easily become an Adios FCGI
thing.”

It at least looks like something to watch. :slight_smile:


David M.
Maia Mailguard - http://www.maiamailguard.com
Morton Software Design and Consulting - http://www.dgrmm.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFELxs3SIxC85HZHLMRAjeFAJ44XqEV9Ak5b+jtJfiP632SnUzS1gCfQ8z7
f1wSngHEtNY55peBr95z4Sg=
=KC87
-----END PGP SIGNATURE-----


#11

Thanks Zed. Mongrel rocks and is effortless. Your hard work is
appreciated.

Michael


#12

David M. wrote:

Compared to fcgi, it’s similar, so if you have a working fcgi
environment, it
may be a tougher call. Of interest to me was:

http://weblog.textdrive.com/article/200/playing-with-lighttpd-litespeed-fcgi-and-mongrel

where they said, “Mongrel as a proxy performs just as well as fcgi does,
either
with lighttpd or litespeed, and could easily become an Adios FCGI
thing.”

After putzing with lighttpd, fcgi, and apache for the better part of a
day on both OSX and Windows, I did the dance of joy when I fired up
mongrel and everything just worked! (on both platforms, I might add).

Our web app will never high hit rates (maybe 10k/day at the outside),
and is 99.5% generated content (little or no static content). While the
hit rate is not high, it must be absolutely stable. Lives won’t exactly
depend on this app, but it is “mission critical”.
The questions I have are

  1. Is there anyone with experience running mongrel for any length of
    time, and how stable did it prove itself to be?
  2. Since we are not serving static content, is there any compelling
    reason not to use mongrel as is, i.e., without lighttpd or apache?

Bottom line question is: Given the parameters above and the fact that we
do not currently have a fcgi system in place, would you go with
mongrel?

TIA,
Keith


#13

Looks good - any thought abt supporting SSL?


#14

Keith L. wrote:

Bottom line question is: Given the parameters above and the fact that we
do not currently have a fcgi system in place, would you go with
mongrel?

I don’t know yet, I’m still evaluating it. Run some benchmarking tests
yourself… :wink:


#15

David M. wrote:

Keith L. wrote:

Bottom line question is: Given the parameters above and the fact that we
do not currently have a fcgi system in place, would you go with
mongrel?

I don’t know yet, I’m still evaluating it. Run some benchmarking tests
yourself… :wink:

I plan on running tests performance test suite against our system using
mongrel. What I was interested in was stability over time on a real
deployment, if one exists given that mongrel is pretty new.

Keith


#16

Keith,

I just finished putting the finishing touches on the first cut at the
stability release 0.3.12.1. It’s the result of spending this weekend
pounding the hell out of a soon-to-be-production deployment. You can
try it
out with:

gem install mongrel --source=http://mongrel.rubyforge.org/releases/

This release has mostly tweaks to the HTTP parser and IO so that Mongrel
detects various bad input types and sizes and then boots the bad clients
early.

Let me know if you can make it crash.

Zed A. Shaw


http://mongrel.rubyforge.org/


#17

Zed S. wrote:

Keith,

I just finished putting the finishing touches on the first cut at the
stability release 0.3.12.1. It’s the result of spending this weekend
pounding the hell out of a soon-to-be-production deployment. You can
try it
out with:

gem install mongrel --source=http://mongrel.rubyforge.org/releases/

This release has mostly tweaks to the HTTP parser and IO so that Mongrel
detects various bad input types and sizes and then boots the bad clients
early.

Let me know if you can make it crash.

Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/

Zed,
I’ll check it out. We are going through our preliminary pilot phase with
a customer and I’m planning on using mongrel for at least this phase
(100’s of hits a day at most). I’ll run some tests today on the release
and let you know if I run into anything.

BTW, GREAT work on this! Its also great that you’ve been funded to
continue work on it.

Keith


#18

Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#19

Hi Sandi,

Responses below…

On 4/3/06 8:21 PM, “Sandi Metz” removed_email_address@domain.invalid wrote:

My apologies if this should be obvious. I’m killing myself and wearing out
google and I still don’t have a clue of what to do about this problem.

I have Apache 2.0.55 httpd.conf set up to use mod_rewrite to proxy requests to
mongrel at http://localhost:3000. All is well. One page of our web app
uploads a file. The upload works just fine.

Yes, apache should handle all the encryption, decryption for your
traffic
before talking to Mongrel.

But now, alas, I try to upload a file. Attempting to upload a file gives me
a ‘bad content body’ error at line 981 of cgi.rb, in the read_multipart
method. If I change that method to write its input out to a log, I see that
$stdin looks very much like encrypted stuff and not at all like clear text.

That is interesting. Do this for me:

  1. gem install mongrel --source=http://mongrel.rubyforge.org/releases/
  2. go to your rails app directory.
  3. mongrel_rails start -B

Now, do your test again doing the SSL and Non-SSL uploads. When it’s
done,
take the contents of log/mongrel_debug/rails.log and post it to a
nopaste
site for me to look at. It’s possible that the headers are mangled
before
coming in but not sure why Apache wouldn’t fix it.

So now, after much not very fruitful head banging, I have a bunch of questions
and I’m hoping that someone can point me in a useful direction.

Should I have done something in the apache config to make ssl decrypt this
file before passing it on to mongrel?
No idea.

Should I have done something in ruby to decrypt this file?
Nope, it should come properly decrypted. Now, it’s possible that it’s
not
really encrypted but instead just encoded in something unfamiliar to
CGI.

Should I be using something like Pound out in front of everything to handle
the en/decryption?

If you can, see if Pound has the same problem. If you can point Pound
at
Mongrel and the file upload works fine, then you just need to fix
apache.
If it still fails then something’s up with mongrel.

Zed A. Shaw


http://mongrel.rubyforge.org/


#20

Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails