Forum: Ruby on Rails [ANN] Mongrel 0.3.1 -- New Site/Runs Right

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-02-12 21:37
(Received via mailing list)
Hello All,

Yet another release of Mongrel proudly pushed out for everyone to review
and
comment on.  This time though, I've done up a little website that's
*way*
better than the plan Rdoc that used to stand in for the site like a
one-legged leper.

* http://mongrel.rubyforge.net/

As you should already know, Mongrel is a fast HTTP server and library
for
Ruby partially written in C.  It supports running Ruby on Rails,
Camping,
and Og+Nitro applications as well as featuring a simple API for others
to
use in their own frameworks.  Performance is usually much higher than
WEBrick while the features are kept much lower.


== 0.3.1 Changes

* This release fixes a *huge* bug in the Rails support where the
Content-length was very very wrong.  People who had weird problems
downloading images should try this release and let me know the results.

* It features a new command and plugin system (thanks to pluginfactory)
with
an initial start and stop command for Ruby on Rails.

* New site that was basically stolen from all sorts of Creative Commons
licensed sources.  Please read the attributions page (
http://mongrel.rubyforge.org/attributions.html) so they get credit.

* Dependency problems with daemons gem solved.


== The New Rails Runner

This release features a mongrel_rails script that has start and stop
commands as well as full options for dictating it's configuration.
Simply
do the following:

 $ sudo gem install mongrel
 $ cd myrailsapp
 $ mongrel_rails start -d

Which runs Mongrel in the background. You can stop it with:

 $ mongrel_rails stop

And you¹re all set.  You can pass the start and stop commands the -h
option
to find out all the possible options.


=== Win32 Folks

The only thing you people need to do right now is avoid the -d option to
start. Win32 doesn¹t support POSIX fork so it won¹t go into the
background.
I¹ll be adding support for making Mongrel a service in a few releases.


== The Next Release

I'll be grabbing all the various Rails applications I can and begin
testing
Mongrel against them.  If anyone is building an application and is
interested in testing Mongrel with their gear then shoot me an e-mail.
There is one outstanding bug with the Rails support which I have to fix,
but
otherwise it's working reasonably well.

Any suggestions for documentation people want are more than welcome.

Finally, I'm looking at a caching mechanism that would involve
dyanmically
storing gzip and regular versions of all returned conent into a
memcached.
I have a small prototype kind of working that does this, but I'm
interested
in people's ideas for what they'd like in a caching system that's
between
Rails page caching and fully dynamic content.


= Love Your Dog?

I'm looking for people who want their buddy featured on the Mongrel
site.
Just post a photo via some photo posting site and let me know where it
is.
I'll make a page for all the "mongrels" out there.  'Cause dogs rule.


Zed A. Shaw
http://www.zedshaw.com/
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-02-12 22:20
(Received via mailing list)
I see your design abilities are as impressive as your coding abilities.
Bravo!

Looking forward to watching Mongrel mature and turn the webapp world on
its ear.

:-D

b
E75cda3e915fa209386fae3de962cb6a?d=identicon&s=25 Michael Schoen (Guest)
on 2006-02-12 22:20
(Received via mailing list)
Sweet! This is coming along nicely. A few comments...

1. Why restrict mongrel_rails to only allow "development" and
"production" as environments? Some folks (like me ;-)) have adding
additional environments, including "qa" and "sandbox".

2. In a similar vein, what do you think about defaulting to
ENV['RAILS_ENV'] if that's set?

3. Are you planning on exposing the num_processors argument to
mongrel_rails, to allow a command-line option for setting it either
higher or lower?

4. Lastly, any plans to allow for a graceful restart?

Thanks again!
Eca15b2b601e7e577d38bd5210a753ac?d=identicon&s=25 Carl Youngblood (Guest)
on 2006-02-12 22:21
(Received via mailing list)
Awesome work!

Don't know if this is related to mongrel at all, but for some weird
reason
when I run my rails app under mongrel, it thinks it's in production mode
instead of development mode, even though my environment.rb settings have
not
changed.

Carl
A9cdc0b24a1ee497ad749afab0ec5c30?d=identicon&s=25 Luigi Rizzo (luigi)
on 2006-02-12 22:27
(Received via mailing list)
Hello Zed. I'm under Windows and when I try installing the mongrel
gem, and I'm also requested to install the daemons dependence. At this
point it seems the system tries to build daemons locally (compiling)
but since I don't have a compiler properly installed it doesn't work.
Is there a binary distribution available for daemons on Windows?
Thanks.
E75cda3e915fa209386fae3de962cb6a?d=identicon&s=25 Michael Schoen (Guest)
on 2006-02-12 22:30
(Received via mailing list)
Carl Youngblood wrote:
> Don't know if this is related to mongrel at all, but for some weird
> reason when I run my rails app under mongrel, it thinks it's in
> production mode instead of development mode, even though my
> environment.rb settings have not changed.

That's because mongrel_rails defaults to production mode, which can be
changed using the -e command line option.

A less surprising default would be to use

	ENV['RAILS_ENV'] || "development"

and let that be overridden w/ -e on the command line.
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-02-12 22:47
(Received via mailing list)
On 2/12/06 4:19 PM, "Michael Schoen" <schoenm@earthlink.net> wrote:

> Sweet! This is coming along nicely. A few comments...
>
> 1. Why restrict mongrel_rails to only allow "development" and
> "production" as environments? Some folks (like me ;-)) have adding
> additional environments, including "qa" and "sandbox".
>
Ah, didn't know people did that.  Alrighty, I'll remove that check.

> 2. In a similar vein, what do you think about defaulting to
> ENV['RAILS_ENV'] if that's set?
>
Good point.  Next release.

> 3. Are you planning on exposing the num_processors argument to
> mongrel_rails, to allow a command-line option for setting it either
> higher or lower?
>
Hey, you read code!  Bastard!  Yeah, I can add that.

> 4. Lastly, any plans to allow for a graceful restart?
>
Yes, that's coming once I get a few more needed things written.

Zed A. Shaw
http://www.zedshaw.com/
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-02-12 22:51
(Received via mailing list)
Not good at design at all, just good at stealing designs people
graciously
give out for others to use.

Of course I think design is the bane of all information existence.  I
just
got done telling someone, "You could wrap a turd in a good design and
people
would eat it like a snickers bar."

Thanks for the compliment though!  I do appreciate it.

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

On 2/12/06 4:21 PM, "Ben Munat" <bent@munat.com> wrote:

> I see your design abilities are as impressive as your coding abilities. Bravo!
>
> Looking forward to watching Mongrel mature and turn the webapp world on its
> ear.
<snip>
>
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-02-12 22:53
(Received via mailing list)
Hey Luigi,

Yeah, I'm planning to figure out how to automate building win32 builds
for
people to download.  I didn't know that daemons requires a compiler, but
mongrel does for sure.

If you're in a hurry I believe you can grab the MS visual studio for
free
these days.

Zed A. Shaw
http://www.zedshaw.com/
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-02-12 22:54
(Received via mailing list)
On 2/12/06 4:30 PM, "Michael Schoen" <schoenm@earthlink.net> wrote:

>
> ENV['RAILS_ENV'] || "development"
>
> and let that be overridden w/ -e on the command line.

As for surprising defaults, I actually went with production since the
idea
is that most people will run WEBrick in dev and Mongrel in production,
but I
guess I could just make it behave like WEBrick if people think that's
better.

Zed A. Shaw
http://www.zedshaw.com/
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-02-12 22:57
(Received via mailing list)
Well, Zed, since you're in the "I'll do that" mode, how about
having mongrel_rails display the Rails environment on startup?

That would eliminate *all* confusion on the issue.

--
-- Tom Mornini
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-02-12 23:01
(Received via mailing list)
Zed Shaw wrote:
> Not good at design at all, just good at stealing designs people graciously
> give out for others to use.
>
> Of course I think design is the bane of all information existence.  I just
> got done telling someone, "You could wrap a turd in a good design and people
> would eat it like a snickers bar."

ROTFL.... so true... so true...

b
E75cda3e915fa209386fae3de962cb6a?d=identicon&s=25 Michael Schoen (Guest)
on 2006-02-12 23:12
(Received via mailing list)
Tom Mornini wrote:
> Well, Zed, since you're in the "I'll do that" mode, how about
> having mongrel_rails display the Rails environment on startup?
>
> That would eliminate *all* confusion on the issue.
>

+1
E75cda3e915fa209386fae3de962cb6a?d=identicon&s=25 Michael Schoen (Guest)
on 2006-02-12 23:13
(Received via mailing list)
> As for surprising defaults, I actually went with production since the idea
> is that most people will run WEBrick in dev and Mongrel in production, but I
> guess I could just make it behave like WEBrick if people think that's
> better.

Ah, didn't think about that -- I like to run the exact same setup in
both dev and production to avoid any unexpected differences. Defaulting
to dev does some "safer" though (for some definition of "safer").
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-02-12 23:56
(Received via mailing list)
Zed


Is Mongrel appropriate for apps running on - heavily - shared accounts?
Would there be any benefit, over lighttpd or Apache?

Alain
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-02-13 01:43
(Received via mailing list)
On 2/12/06 5:55 PM, "Alain Ravet" <arav2132@biz.tiscali.be> wrote:

> Is Mongrel appropriate for apps running on - heavily - shared accounts?
> Would there be any benefit, over lighttpd or Apache?
>

Well, Mongrel is still being worked on so putting it into production
probably isn't the smartest move right now.

In the future I can see people going one of several ways with shared
accounts:

1)  lighttpd or apache acting as a simple mod_proxy front end talking to
a
Mongrel backend for anything Rails.
2)  A smart load balancer like BalanceNG or a Cisco which routes
requests
for you based on content.  Again, static content served with apache or
lighttpd and dynamic with Mongrel.
3)  Simply serve the whole mess with Mongrel directly.  This might work
great for people hosting lots of tiny little applications.

The main thing with large shared hosting systems is port management.
Usually people rely on something like VPS as well.

Zed A. Shaw
http://www.zedshaw.com/
08c61efb47d4b99e8b0b52b10aec3910?d=identicon&s=25 Eduardo Fernandez Corrales (Guest)
on 2006-02-13 12:05
(Received via mailing list)
Zed, I am getting an error, see below:

On 2/12/06, Zed Shaw <zedshaw@zedshaw.com> wrote:
...
>  $ sudo gem install mongrel
>  $ cd myrailsapp
>  $ mongrel_rails start -d

Installed the gem (and demons) with no problem, but:

> mongrel_rails start -p 3333
Running at 0.0.0.0:3333
calling Dispatcher.dispatch undefined method `index' for nil:NilClass
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/bin/mongrel_rails:32:in
`status'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/bin/mongrel_rails:74:in
`process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/lib/mongrel.rb:363:in
`process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/lib/mongrel.rb:328:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/lib/mongrel.rb:326:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/lib/mongrel.rb:326:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/bin/mongrel_rails:125:in
`run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/lib/mongrel/command.rb:183:in
`run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.1/bin/mongrel_rails:171
/usr/local/bin/mongrel_rails:18

The same request works with webrick. Using:

edu> uname -a;ruby -v
Darwin copito.local 8.4.0 Darwin Kernel Version 8.4.0: Tue Jan  3
18:22:10 PST 2006; root:xnu-792.6.56.obj~1/RELEASE_PPC Power Macintosh
powerpc
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.3.0]

Am I doing something wrong? Thanks.
--
Eduardo Fernández Corrales
This topic is locked and can not be replied to.