[ANN] Mongrel 0.3.6 -- Win32 Service/Rails Real Good


#1

Hello Folks,

This release of Mongrel should make the win32 folks go crazy. Thanks to
Luis L. it supports a full service system for installing any Rails
app
as a service. This lets you start your rails apps from either the
command
line or the Service console. Stopping is still a bit problematic but we
hope to have that solved in the next release.

You win32 folks should probably send Luis cookies or something since his
work just plain rocks. It’s rare in a Ruby project that the win32
support
starts to get better than the POSIX systems.

== What is Mongrel?

Mongrel is a fast HTTP library and server for Ruby that is intended for
hosting Ruby web applications of any kind using plain HTTP rather than
FastCGI or SCGI. It is framework agnostic and already supports Ruby On
Rails, Og+Nitro, and Camping frameworks.

== Changes for 0.3.6

  • A really complete win32 service runner for installing any Rails app as
    a
    Mongrel service.
  • Lots of fixes to the Rails support and CGIWrapper. Other frameworks
    should be able to poach all the starter/runner scripts (even the service
    one) and replicate this setup.
  • Support for specifying a YAML file of additional MIME types you need.
    Mongrel has a few but you can specify more. This is available for both
    the
    win32 service and regular mongrel_rails runner.
  • It’s been used heavily by myself and others while in development mode
    so
    it should be usable for many people.
  • content-type and redirects from behind a proxy are working again.
  • A bunch of documentation on how to run Mongrel in various situations
    with
    more to come.
  • Win32 gem no longer depends on daemons. Other systems do depend on
    it.

– Only thing with the win32 service is that stopping is a bit broken.
Nothing big though since everyone loves Mongrel so much they probably
will
never stop it.

== Installing The Goods

For non-win32 people just do:

$ gem install mongrel

Or gem upgrade if you’ve already got Mongrel.

For win32 folks I had to build a special win32-service gem based on Dan
Berger’s fantastic work. You’ll need to do this:

$ gem install win32-service
$ gem install mongrel

If you alredy have win32-service installed then skip the first command.
The
gem for win32-service is based on the 0.5.0 version.

== Using The Win32 Service

There’s a more extensive doc here:

http://mongrel.rubyforge.org/docs/win32.html

But for the impatient, do this:

$ mongrel_rails_service install -n myapp
-r c:\my\path\to\myapp -p 4000 -e production
$ mongrel_rails_service start -n myapp

And you’re hooked up. You can also still use the previous method of
just
running it from the command line with mongrel_rails start but use
CTRL-Pause/Break to stop (not CTRL-C).

== Mailing L.

We’ve been doing pre-release announcements and discussing development on
the
mailing list. Feel free to join
http://rubyforge.org/mailman/listinfo/mongrel-users

== Next Release

We should have the stopping problem cleaned up and maybe a few more
win32
goodies as well. There should also be the start of a filtering setup
which
will lead to some caching, gzip/deflate content, and security controls.

Feel free to request any other features and report bugs.

Zed A. Shaw


#2

Thanks Luis! This is awesome! Being able to start from command line,
or
restart after a reboot, will be a big plus.

while jar.cookie? {|cookie|
cookie.send_to_Luis}
end

-Larry

On 2/22/06, Zed S. removed_email_address@domain.invalid wrote:

work just plain rocks. It’s rare in a Ruby project that the win32 support

win32 service and regular mongrel_rails runner.
never stop it.
For win32 folks I had to build a special win32-service gem based on Dan
== Using The Win32 Service
$ mongrel_rails_service start -n myapp
mailing list. Feel free to join
Feel free to request any other features and report bugs.

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


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


Best Regards,
-Larry
“Work, work, work…there is no satisfactory alternative.”
— E.Taft Benson


#3

Hello Zed. Thanks for this release!

I just attempted to run instiki (the latest SVN release) with the new
service mode, but I get a few errors/warning (all in all “strange”
behaviors that made the instiki system behaving unreliably) in the
instiki window (sorry I can’t be more precise about those at the
moment).

When I reverted to the command line mode (with mongrel 3.6.0) I get
some errors on the console (as I got before) but instiki behaves
consistently as expected.

Example of console messages I got with instiki and mongrel (command line
mode).

Running Mongrel server in production mode at 0.0.0.0:2500
Server ready.
./config/…/lib/bluecloth_tweaked.rb:85: warning: already initialized
constant V
ersion
./config/…/lib/bluecloth_tweaked.rb:88: warning: already initialized
constant S
vnRev
./config/…/lib/bluecloth_tweaked.rb:91: warning: already initialized
constant S
vnId
./config/…/lib/bluecloth_tweaked.rb:94: warning: already initialized
constant S
vnUrl
./config/…/lib/bluecloth_tweaked.rb:100: warning: redefining constant
Struct::R
enderState
./config/…/lib/bluecloth_tweaked.rb:100: warning: already initialized
constant
RenderState
./config/…/lib/bluecloth_tweaked.rb:103: warning: already initialized
constant
TabWidth
./config/…/lib/bluecloth_tweaked.rb:106: warning: already initialized
constant
EmptyElementSuffix

Hope this helps with some debugging.

Regards,

–L


#4

Thank you for the great work on “Tomcat for Ruby”!

However, I’m not sure if I’m the only person who feels mongrel-win32 is
around 30%-50% slower than webrick under production environment. The
timer
coming from fasterfox plugin makes me surprised on the responding time
of
pagination.

Sky


#5

On Wed, 22 Feb 2006 13:56:19 -0500, Zed S. wrote:

Mongrel is a fast HTTP library and server for Ruby that is intended for
hosting Ruby web applications of any kind using plain HTTP rather than
FastCGI or SCGI. It is framework agnostic and already supports Ruby On
Rails, Og+Nitro, and Camping frameworks.

This is really amazing progress.

Will Mongrel (eventually) be able to deal with things like
upload_progress,
which requires the ability to process upload_status requests while the
upload is still in progress? Or is it single-threaded?

Jay L.


#6

Great work Zed and Luis! Quick question, since the restarting
(stopping) is an issue, how does one go about updating an app cleanly
in production? Apache’s graceful restart is very nice as it doesn’t
kick anybody out still trying to make a request!

Thanks a bunch!
-Nick


#7

It should be able to do it, but I have to work out the particulars with
the
rails-core gang. I’d prefer that Mongrel handle file uploads rather
than
passing the stuff to rails or CGI lib.

Additionally, I’m probably going to get in and write another fast
multi-part
mime parsing extension similar to the http extension. The mime decoding
(actually all decoding) in CGI is really really really slow.

Zed A. Shaw


#8

luigi, to me looks like bluecloth_tweaked gets loaded in every request.

haven’t tested instiki here, but for our rails app, blog and cart
samples from agile book, it worked ok with mongrel.

If instiki is plain-stock, without modification will be something to
look into, but doubt is directly related to the way mongrel handle it.

Let me know if you solved or dig into this. I’ll do it during weekend
and let everyone know.

Luis

luigi rizzo wrote:

When I reverted to the command line mode (with mongrel 3.6.0) I get
some errors on the console (as I got before) but instiki behaves
consistently as expected.

Example of console messages I got with instiki and mongrel (command line
mode).

Running Mongrel server in production mode at 0.0.0.0:2500
Server ready.
./config/…/lib/bluecloth_tweaked.rb:85: warning: already initialized
constant Version
./config/…/lib/bluecloth_tweaked.rb:88: warning: already initialized
constant SvnRev
./config/…/lib/bluecloth_tweaked.rb:91: warning: already initialized
constant SvnId
./config/…/lib/bluecloth_tweaked.rb:94: warning: already initialized
constant SvnUrl
./config/…/lib/bluecloth_tweaked.rb:100: warning: redefining constant
Struct::RenderState
./config/…/lib/bluecloth_tweaked.rb:100: warning: already initialized
constant RenderState
./config/…/lib/bluecloth_tweaked.rb:103: warning: already initialized
constant TabWidth


#9

On Feb 24, 2006, at 11:15 AM, Luis L. wrote:

Anyway if you require that high uptimes, I sugest a pool of rails
services, load-balanced behind another proxy/web server.

But then you must take in consideration record-lock and
transactions for
your db.

You must take those into consideration in any case, unless you’re
running
a single threaded Rails setup, which would be a very strange setup
indeed.


– Tom M.


#10

Nick S. wrote:

Great work Zed and Luis! Quick question, since the restarting
(stopping) is an issue, how does one go about updating an app cleanly
in production? Apache’s graceful restart is very nice as it doesn’t
kick anybody out still trying to make a request!

Thanks a bunch!
-Nick

Nick, I have commited some modification to services that make stop work
(need more testing though) hope get them in the next release.

Don’t know how apache do things, but “restarting” your service involve
stopping it, and starting it again.

Stopping requires all the connections are terminated, and loading all
the rails env requires upto 10 seconds in my 800mhz p3.

Anyway if you require that high uptimes, I sugest a pool of rails
services, load-balanced behind another proxy/web server.

But then you must take in consideration record-lock and transactions for
your db.

Later,

Luis


#11

luis,

besides the mail i sent you separately, i’m sorry i forgot to mention
i’m running mongrel on port 2500 (as i said, on a windows 2003
machine), but accessing it from another machine via an apache server
which is responding on port 80 (see below the .conf file).

apache conf:
<VirtualHost *:80>
ServerName wiki…xyz…com
RewriteEngine On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:2500/
ProxyPassReverse / http://localhost:2500/

–l