Mod_Rails Released - Post your Thoughts

3 views
Skip to first unread message

ChessMess

unread,
Apr 11, 2008, 3:22:05 PM4/11/08
to Ruby on Rails: Talk
http://modrails.com/

Mod_Rails is out, so what do you think?

James Byrne

unread,
Apr 11, 2008, 3:26:38 PM4/11/08
to rubyonra...@googlegroups.com
ChessMess wrote:
> http://modrails.com/
>
> Mod_Rails is out, so what do you think?

I think that I might give it a try out.
--
Posted via http://www.ruby-forum.com/.

Nathan Esquenazi

unread,
Apr 11, 2008, 5:23:38 PM4/11/08
to rubyonra...@googlegroups.com
Let's see:

- Faster than mongrel, on par with thin
- Thoroughly tested and profiled for stability
- Two lines of installation and a small snippet of code in apache config
- Free to use and completely open source

I would say this is an exciting day for rails.

Sam Granieri

unread,
Apr 11, 2008, 5:42:58 PM4/11/08
to rubyonra...@googlegroups.com
So far so good. I like not having to deal with cleaning up after mongrel.

I have to reconfigure my capistrano scripts to reflect this, but i like
what I see.

DyingToLearn

unread,
Apr 11, 2008, 8:41:00 PM4/11/08
to Ruby on Rails: Talk
This looks great. Would one ever use this in a development/testing
environment?

Thanks

John Harrison

unread,
Apr 11, 2008, 9:55:25 PM4/11/08
to rubyonra...@googlegroups.com
ChessMess wrote:
> http://modrails.com/
>
> Mod_Rails is out, so what do you think?

I added a .htaccess file to my app root containing:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>

So now i can drag and drop the whole app into the folder without
pointing the root to the public folder (one extra step less).

I really like it.

Rahil Kantharia

unread,
Apr 12, 2008, 8:16:36 AM4/12/08
to rubyonra...@googlegroups.com
Great day for Ruby on Rails.

We do not have a single reason now to envy PHP or Asp.Net, when it comes
to deployment.

I am full of cheers...

lets see, what rubinius does with with such inspiration.

Phillip Koebbe

unread,
Apr 12, 2008, 10:40:37 AM4/12/08
to rubyonra...@googlegroups.com
John Harrison wrote:
>
> I added a .htaccess file to my app root containing:
>
> <IfModule mod_rewrite.c>
> RewriteEngine on
> RewriteRule ^$ public/ [L]
> RewriteRule (.*) public/$1 [L]
> </IfModule>
>
> So now i can drag and drop the whole app into the folder without
> pointing the root to the public folder (one extra step less).
>
> I really like it.

John,

Would you mind explaining what you mean? If you still have to set up a
virtual host in your apache config, what step are you saving since you
have to define DocumentRoot? If you are talking about being able to use
the same domain and have the Rails app appear "under" it, such as

www.mydomain.com/my_rails_app

wouldn't that require something like a prefix in the app so your
generated routes would be correct? I'm thinking of the situation where
you have to apps living next to each other like

www.mydomain.com/rails_app_1
www.mydomain.com/rails_app_2

and how you'd need a prefix in both apps for the routes to work.

I might be missing something, though. I'd really like to be able to
have many apps live under one domain easily.

Thanks,
Phillip

Bill Walton

unread,
Apr 12, 2008, 11:54:18 AM4/12/08
to rubyonra...@googlegroups.com
Exceptional! Any chance we'll see a Windows executable, maybe packageable
with Instant Rails?

Best regards,
Bill

feli...@gmail.com

unread,
Apr 12, 2008, 5:14:01 PM4/12/08
to Ruby on Rails: Talk
I think this is one of the best things to happen to RoR lately.

On Apr 11, 12:22 pm, ChessMess <chessm...@gmail.com> wrote:

Warlock handleR

unread,
Apr 12, 2008, 7:03:04 PM4/12/08
to rubyonra...@googlegroups.com
wowwwwwwwwwwwwwwwwwwwwwwwwwwwwwww i seen this a day late... but still
wowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

anyone who has tried it... can post some reviews?

William Li

unread,
Apr 13, 2008, 6:39:42 AM4/13/08
to rubyonra...@googlegroups.com
We have been testing mod_rails over the past 48 hours or so and have it
installed on our most recent shared server for clients to use. Thus far
we're skeptical if it will be more stable than a Mongrel cluster in a
shared environment but it certainly works as expected; upload your files
and you're done (and it's speedy, too).

Testing with a fresh install of redmine-0.6 on RHEL5 w/ Apache 2.2.8,
Mongrel 1.1.4, ruby 1.8.6 PL114, passenger 1.0.1 we've noticed a few
things:

1) The app fired up in a Mongrel instance uses 35MB RES.

2) The app fired up with mod_rails loads an ApplicationSpawner (40MB
RES), a rails instance (39MB RES), and a FrameworkSpawner (25MB RES).
The FrameworkSpawner only seems to run if you have Rails gems frozen in
the app.

3) If the app hasn't been hit within the RailsPoolIdleTime the
ApplicationSpawner/RailsInstance/FrameworkSpawner all die away. The next
hit takes a few seconds for these to load again (remind you of
something?).

At this point for shared clients we're still recommending Mongrel
clusters over mod_rails (Mongrels on average take less memory out of
your quota and are 'always on') but are happy to offer both. Let me
know if you'd like to see any further details on the above or have any
other questions.

Cheers,
~William
http://www.hostingrails.com
http://www.hostingrails.com/mod_rails_hosting

DyingToLearn

unread,
Apr 13, 2008, 4:19:44 PM4/13/08
to Ruby on Rails: Talk
@William,

What about those with many different rails apps, all with low volume?
So for example, if I had 10 apps, (each with <5 visits per day) I
would need 10 mongrels. Using you example numbers, that is 350MB.
However, if I used mod_rails, and I had the same 350MB available,
would it share the available memory between only the running apps?
That would (in theory) make the running apps faster, after the initial
slow requets.

Thanks,
Paul

On Apr 13, 3:39 am, William Li <rails-mailing-l...@andreas-s.net>
wrote:

William Li

unread,
Apr 14, 2008, 1:16:38 AM4/14/08
to rubyonra...@googlegroups.com
Hi Paul, with <5 visits per day per app I don't think you'd see much of
a functional difference overall between mod_rails and mod_fcgid; the
former may be more stable (hopefully) but the ladder takes much less
memory, is widely supported, and is therefore much less expensive.
Mod_rails was built for speed, stability, and robustness with ease of
deployment, but as of passenger-1.0.1 our tests have shown that for an
app with a steady stream of visitors this comes at the cost of requiring
more memory than the two most common methods of hosting Rails in a
shared environment combined. At the end of the day, it appears that if
all goes well mod_rails will be for those who won't mind paying a lot of
RAM for a bit more performance and deployment freedom.

~William
http://www.hostingrails.com

DyingToLearn wrote:
> @William,
>
> What about those with many different rails apps, all with low volume?
> So for example, if I had 10 apps, (each with <5 visits per day) I
> would need 10 mongrels. Using you example numbers, that is 350MB.
> However, if I used mod_rails, and I had the same 350MB available,
> would it share the available memory between only the running apps?
> That would (in theory) make the running apps faster, after the initial
> slow requets.
>
> Thanks,
> Paul
>
> On Apr 13, 3:39�am, William Li <rails-mailing-l...@andreas-s.net>

--
Posted via http://www.ruby-forum.com/.

AtsoK

unread,
Apr 14, 2008, 1:46:30 AM4/14/08
to Ruby on Rails: Talk
Just installed Passenger, and I love it. Works flawlessly with all of
my Rails apps. However, when pointing my browser to all of my apps, it
takes a while to load (around 30 seconds) but then it's really fast
after that. Is this normal, do I need to make any optimizations, or is
it just because of my sluggish iBook?

John Honovich

unread,
Apr 14, 2008, 2:43:59 AM4/14/08
to rubyonra...@googlegroups.com
Install and setup was easy. Production logs indicate rails performance
is faster.

Main problem I have right now is that static content (images, js files)
seem to be taking 2 to 3 longer to download than when I was using
Apache/Mongrel (measured using firebug's net tab).

Anyone else seeing an issue with static content download speed?

Pratik

unread,
Apr 14, 2008, 7:26:19 AM4/14/08
to rubyonra...@googlegroups.com
William,

Could you have a look at
http://groups.google.com/group/phusion-passenger/browse_thread/thread/e6dc620227ed7b4c
and repeat your experiment ?

Passenger is designed to work best with GC enabled ruby patch
http://izumi.plan99.net/blog/index.php/2008/01/14/making-ruby%E2%80%99s-garbage-collector-copy-on-write-friendly-part-7
from the memory point of view. I'll need to convince Hongli/Ninh to
make that information a bit more clear :)

With GC patch, each rails application can share the framework code in
memory and that results in huge memory savings.

-Pratik

--
Cheers!
- Pratik
http://m.onkey.org

Hongli Lai

unread,
Apr 14, 2008, 8:41:48 AM4/14/08
to Ruby on Rails: Talk
On Apr 14, 1:26 pm, Pratik <pratikn...@gmail.com> wrote:
> William,
>
> Could you have a look athttp://groups.google.com/group/phusion-passenger/browse_thread/thread...
> and repeat your experiment ?

Hi.

Thanks for explanation this Pratik. I wanted to say the same thing but
you beat me to it. :)


> Passenger is designed to work best with GC enabled ruby patchhttp://izumi.plan99.net/blog/index.php/2008/01/14/making-ruby%E2%80%9...
> from the memory point of view. I'll need to convince Hongli/Ninh to
> make that information a bit more clear :)
>
> With GC patch, each rails application can share the framework code in
> memory and that results in huge memory savings.
>
> -Pratik

We're going to publish this work as "Ruby Enterprise Edition". Because
of the amount of work that had to be put into Passenger's release, we
haven't had the time to do that yet. Please watch www.rubyenterpriseedition.com
(or our blog) for updates.

Regards,
Hongli Lai (phusion.nl)

admini...@machdudas.de

unread,
Apr 14, 2008, 12:17:49 PM4/14/08
to Ruby on Rails: Talk
Mod Rails ist just great, the only problem i currently have is how to
setup
basic authentication so that you have to log in to get to the
application?

If I try the following:
<Directory "/var/rails/mdd/current/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
AuthName "Login"
AuthType Basic
AuthUserFile /var/rails/mdd/.htpasswd
Require user mdd
</Directory>

Then only my static assets are password protected.

How can i solve this?

TIA
Andy

Jeremy McAnally

unread,
Apr 14, 2008, 2:57:43 PM4/14/08
to rubyonra...@googlegroups.com
It shares code even if I vendor Rails?

--Jeremy

--
http://jeremymcanally.com/
http://entp.com

Read my books:
Ruby in Practice (http://manning.com/mcanally/)
My free Ruby e-book (http://humblelittlerubybook.com/)

Or, my blogs:
http://mrneighborly.com
http://rubyinpractice.com

Xdmx Xdmx

unread,
Apr 14, 2008, 3:13:38 PM4/14/08
to rubyonra...@googlegroups.com
The first thought when i read about mod_rails was: "woooooooooooow
,cooool", but the i read the William Li's post, and then it became a
"mmm...seems cool..."
How much does mod_rails require instead of mongrel?
I've to setup a server with apache and 3-4 rails apps, would be better
going with mongrel or mod_rails ? and, does happen frequently that the
processes are killed and then it takes "a lot" to restart (fcgi like :(
)?
Thanks

Hongli Lai

unread,
Apr 14, 2008, 6:59:12 PM4/14/08
to Ruby on Rails: Talk
On Apr 14, 8:57 pm, "Jeremy McAnally" <jeremymcana...@gmail.com>
wrote:
> It shares code even if I vendor Rails?

It does this to the best of its ability, yes. But it would be most
efficient to use a non-vendor Rails.

Hongli Lai

unread,
Apr 14, 2008, 7:06:00 PM4/14/08
to Ruby on Rails: Talk
On Apr 14, 9:13 pm, Xdmx Xdmx <rails-mailing-l...@andreas-s.net>
wrote:
You may also be interested in reading this:
http://www.pervasivecode.com/blog/2008/04/14/why-mod_rails-is-a-really-good-thing-for-light-duty-ruby-on-rails/#comment-5794
This blog post (as well as my replies) explain how the different
Passenger spawners work, and their implications on memory usage.

To make a long story short: the framework spawner that William saw
only lives temporary. It has an idle timeout of 1 hour, so after 1
hour of idling, memory usage will drop again. Furthermore, our soon to
be released "Ruby Enterprise Edition" will allow an additional memory
reduction of 33% on average. (yes, we're aware of the name, please
bear with us for now ;)

To William: perhaps it would be a good idea to tweak the spawn servers
timeouts. The timeouts for the framework spawner and application
spawner are 1 hour and 2 minutes, respectively. If you tweak them to a
very low number, and increase RailsPoolIdleTime, then Passenger's
spawning strategy essentially becomes the same as FastCGI. The spawn
server timeouts are defined as constants in lib/passenger/
spawn_manager.rb (FRAMEWORK_SPAWNER_MAX_IDLE_TIME) and lib/passenger/
framework_spawner.rb (APP_SPAWNER_MAX_IDLE_TIME).

Regards,
Hongli Lai
- phusion.nl

Chris Olsen

unread,
Apr 15, 2008, 2:38:43 AM4/15/08
to rubyonra...@googlegroups.com
William Li wrote:
Let me
> know if you'd like to see any further details on the above or have any
> other questions.

What would be the verdict for a server running a single application that
gets a couple thousand hits a day?

Would mod_rails be worth it or is mongrel the way to go?

Thanks

Roger Pack

unread,
Apr 15, 2008, 2:53:47 AM4/15/08
to rubyonra...@googlegroups.com
ChessMess wrote:
> http://modrails.com/
>
> Mod_Rails is out, so what do you think?

The thoughts that I had for it were
1) it shares code base among rails instances--maybe it could also load
some very popular gems, to cut down on the startup time [like
activemerchant, redcloth, etc.)
2) It looks like it handles static stuffs well--it would be sweet if it
handled all of that on the apache side [inc. asset managed rails 2.0
stuff] so that the rails handlers were freed to serve 'real' requests.

Way to go gentlemen.
-R

Conrad Taylor

unread,
Apr 15, 2008, 3:17:14 AM4/15/08
to rubyonra...@googlegroups.com
Hi, I was wondering, would it be possible to run Ruby scripts on top of Apache using mod_rails?  If this is the case, it may be better to name the product mod_ruby.

Great job,

-Conrad

Roger Pack

unread,
Apr 15, 2008, 10:43:09 AM4/15/08
to rubyonra...@googlegroups.com
Roger Pack wrote:
> ChessMess wrote:
>> http://modrails.com/
>>
>> Mod_Rails is out, so what do you think?
>

Also I assume it 'takes care' of running ruby processes like not letting
them grow too large and if they take too long on a request, killing
them?
What if a site is very popular--it might be nice to spawn up several
threads to handle its incoming requests.
That feature would rock.

Another sweet idea would be to patch the GC to use fixed side
[small-ish?] heap chunks so that ruby can reclaim memory more easily on
GC. That would be nice, too.
Take care!

Xdmx Xdmx

unread,
Apr 15, 2008, 3:06:04 PM4/15/08
to rubyonra...@googlegroups.com
Hongli Lai wrote:

Very interesting. But i've some questions :)

what would you suggest between the normal ruby (so not yours)+mongrel
and the normal ruby+mod_rails considering the server would run about 2
rails apps with a medium traffic and other 2 apps with a low traffic ?

With more apps a mongrel+mongrel_proxy you'd set some mongrels to one
app, some to another, etc...with instances of 30-40mb each. How would
works with mod_rails? About how much memory would take?

After 1 hour the FrameworkSpawner is stopped and after 2 minutes the
ApplicationSpawner too. How long would take to them to restart? Or
better, when they're not running, how long would take approximately to
the user to show the first time the page? and what about if the
framework is running and the app not? in that case how much would it
takes?


Thanks :)

Roger Pack

unread,
Apr 15, 2008, 3:21:29 PM4/15/08
to rubyonra...@googlegroups.com
> what would you suggest between the normal ruby (so not yours)+mongrel
> and the normal ruby+mod_rails considering the server would run about 2
> rails apps with a medium traffic and other 2 apps with a low traffic ?

I'm guessing if you are real short on RAM, like in a shared environment,
mod_rails is better [since it collects ruby processes after awhile].
If you use the patched GC, that is.

> With more apps a mongrel+mongrel_proxy you'd set some mongrels to one
> app, some to another, etc...with instances of 30-40mb each. How would
> works with mod_rails? About how much memory would take?

I'm not sure how mod_rails works with firing up 'multiple spawned
threads' of the same rails instance, to handle requests. Would be a
nice feature, though.

>
> After 1 hour the FrameworkSpawner is stopped and after 2 minutes the
> ApplicationSpawner too. How long would take to them to restart? Or
> better, when they're not running, how long would take approximately to
> the user to show the first time the page? and what about if the
> framework is running and the app not? in that case how much would it
> takes?

Some report 2s, other 5.

Another thought or suggestion I'd have for mod_rails would be to [like
bleak house] auto-install ruby_gc_friendly alongside the normal ruby
[compile it on the fly]. That might be nice. or maybe another gem to
do the same.
Take care!
-R

Xdmx Xdmx

unread,
Apr 15, 2008, 3:36:30 PM4/15/08
to rubyonra...@googlegroups.com
Roger Pack wrote:
> I'm guessing if you are real short on RAM, like in a shared environment,
> mod_rails is better [since it collects ruby processes after awhile].
> If you use the patched GC, that is.
>

Actually i've a vps with 1 gb of ram, which would run that rails apps
plus a php apps (with a medium traffic) plus the usual stuff which every
common server has (ftp, postfix, mysql, etc)

> I'm not sure how mod_rails works with firing up 'multiple spawned
> threads' of the same rails instance, to handle requests. Would be a
> nice feature, though.

yes :)

> Some report 2s, other 5.

With just the app down or with the app and the framework?

> Another thought or suggestion I'd have for mod_rails would be to [like
> bleak house] auto-install ruby_gc_friendly alongside the normal ruby
> [compile it on the fly]. That might be nice. or maybe another gem to
> do the same.

this would be really nice

Roger Pack

unread,
Apr 15, 2008, 3:43:11 PM4/15/08
to rubyonra...@googlegroups.com

> Actually i've a vps with 1 gb of ram, which would run that rails apps
> plus a php apps (with a medium traffic) plus the usual stuff which every
> common server has (ftp, postfix, mysql, etc)

mod rails would give an easy way to set things up, which is nice. Less
of a headache :)
If you did have the load to want more than one processing app, I'm not
sure if you'd [at that point] need mongrel or not.


> With just the app down or with the app and the framework?

per app I think. I'm not sure totally, but I think so. Subsequent
requests are fast.

Roger Pack

unread,
Apr 16, 2008, 9:15:16 PM4/16/08
to rubyonra...@googlegroups.com
ChessMess wrote:
> http://modrails.com/
>
> Mod_Rails is out, so what do you think?

Would be really nice if it handled code changes gracefully as well [i.e.
after an SVN up it automagically restarted the spawned threads).
It probably does.
Thanks for all your work on this!
-R

Roger Pack

unread,
Apr 17, 2008, 1:10:27 PM4/17/08
to rubyonra...@googlegroups.com
ChessMess wrote:
> http://modrails.com/
>
> Mod_Rails is out, so what do you think?

Another thought would be
...
as I see it, mod_rails forks off a handler per request, which handler
then dies.
Maybe if it kept the pre-forked handler around for a few requests it
would save speed?
Also it would be nice to have documentation on how and when to use or
not use GC.disable to speed up requests [ex: small-ish requests you may
as well turn the GC off, in case it's a speed impediment]. I'm not sure
if the GC is a problem or not. Might be worth having the Ruby that is
'pre-fork' run GC more frequently so that its forked children don't have
to, too.
Perhaps variables for tweaking how often the GC is fired.
Thanks again.

Hongli Lai

unread,
Apr 19, 2008, 5:06:01 PM4/19/08
to Ruby on Rails: Talk
On Apr 15, 8:53 am, Roger Pack <rails-mailing-l...@andreas-s.net>
wrote:
> The thoughts that I had for it were
> 1) it shares code base among rails instances--maybe it could also load
> some very popular gems, to cut down on the startup time [like
> activemerchant, redcloth, etc.)

Hi Roger.

This is correct. It can be used to share Gem code memory among
different Rails processes. But it will only have a real effect if you
use our copy-on-write friendly Ruby branch, which will soon be
released.

With kind regards,
Hongli Lai
- phusion.nl

Hongli Lai

unread,
Apr 19, 2008, 5:08:28 PM4/19/08
to Ruby on Rails: Talk
On Apr 15, 9:17 am, "Conrad Taylor" <conra...@gmail.com> wrote:
> Hi, I was wondering, would it be possible to run Ruby scripts on top of
> Apache using mod_rails?  If this is the case, it may be better to name the
> product mod_ruby.
> Great job,
>
> -Conrad

Hi Conrad.

This is not possible at the moment. Passenger is specialized in Rails
only.

Hongli Lai

unread,
Apr 19, 2008, 5:09:36 PM4/19/08
to Ruby on Rails: Talk
On Apr 15, 4:43 pm, Roger Pack <rails-mailing-l...@andreas-s.net>
wrote:
> Also I assume it 'takes care' of running ruby processes like not letting
> them grow too large and if they take too long on a request, killing
> them?
> What if a site is very popular--it might be nice to spawn up several
> threads to handle its incoming requests.
> That feature would rock.

This is actually what it already does. It spawns more Rails
dispatchers as traffic increases.

Hongli Lai

unread,
Apr 19, 2008, 5:18:02 PM4/19/08
to Ruby on Rails: Talk
On Apr 15, 9:06 pm, Xdmx Xdmx <rails-mailing-l...@andreas-s.net>
wrote:
> Hongli Lai wrote:
> > You may also be interested in reading this:
> >http://www.pervasivecode.com/blog/2008/04/14/why-mod_rails-is-a-reall...
>
> Very interesting. But i've some questions :)

Hi Xdmx.

Sorry for the late reply, we've been getting swamped with work lately,
and I haven't had time to reply until today.


> what would you suggest between the normal ruby (so not yours)+mongrel
> and the normal ruby+mod_rails considering the server would run about 2
> rails apps with a medium traffic and other 2 apps with a low traffic ?
>
> With more apps a mongrel+mongrel_proxy you'd set some mongrels to one
> app, some to another, etc...with instances of 30-40mb each. How would
> works with mod_rails? About how much memory would take?

I suggest you to not do anything. ;) Passenger handles all that stuff
automatically. If site A is having more traffic, then Passenger will
spawn more dispatchers for that site. If B is having more traffic,
then Passenger will spawn mnore dispatcher for that site. If traffic
decreases then Passenger will clean up dispatchers.

The point of Passenger is to relieve you of administrative overhead,
like managing Mongrel instance numbers. :)


> After 1 hour the FrameworkSpawner is stopped and after 2 minutes the
> ApplicationSpawner too. How long would take to them to restart?
> Or
> better, when they're not running, how long would take approximately to
> the user to show the first time the page?

That depends on a number of factors. By far the largest factor in
startup time, is disk I/O. Ruby on Rails consists of hundreds of
little files, and startup time on a cold start is dominated by disk
seeking performance.

On my laptop, a cold start takes about 7 seconds. A warm start
(without FrameworkSpawner/ApplicationSpawner running) takes about 2
seconds because disk I/O bottlenecks are eliminated. Some people have
reported a cold startup time of 25 seconds, but that really depends on
the system's CPU load and I/O load.


> and what about if the
> framework is running and the app not? in that case how much would it
> takes?

If the FrameworkSpawner is running, then spawning time will decrease
significantly. The framework will not have to be loaded at all - only
the application code will have to be loaded. How long that takes
depends on the application though. A "hello world" application starts
almost immediately if FrameworkSpawner is already running.

Hongli Lai

unread,
Apr 19, 2008, 5:19:35 PM4/19/08
to Ruby on Rails: Talk
On Apr 17, 3:15 am, Roger Pack <rails-mailing-l...@andreas-s.net>
wrote:
> Would be really nice if it handled code changes gracefully as well [i.e.
> after an SVN up it automagically restarted the spawned threads).
> It probably does.
> Thanks for all your work on this!

Yes we've considered this possibility. Unfortunately it's impossible
to implement this efficiently. In the worst case it will have to poll
every single application source file from time to time. We figured
that it's just easier and more efficient to tell the user touch tmp/
restart.txt.

Hongli Lai

unread,
Apr 19, 2008, 5:21:48 PM4/19/08
to Ruby on Rails: Talk
On Apr 17, 7:10 pm, Roger Pack <rails-mailing-l...@andreas-s.net>
wrote:
> Another thought would be
> ...
> as I see it, mod_rails forks off a handler per request, which handler
> then dies.

This is actually not correct. Spawning and forking is slow, so we keep
a pool of spawned Rails handlers around, and we reuse them as much as
we can.


> Maybe if it kept the pre-forked handler around for a few requests it
> would save speed?

We already do this. :)


> Perhaps variables for tweaking how often the GC is fired.
> Thanks again.

Our Ruby branch actually provides this information. Please stay tuned
for the release. :)

Roger Pack

unread,
Apr 19, 2008, 11:28:31 PM4/19/08
to rubyonra...@googlegroups.com

>> Perhaps variables for tweaking how often the GC is fired.
>> Thanks again.
>
> Our Ruby branch actually provides this information. Please stay tuned
> for the release. :)
Rock on. Thanks for doing this so the rest of us don't have to.
As noted--I assume it kills processes if they take too much time or
begin to use too much RAM [maybe could run 'GC.start' on them first
before killing them for consuming RAM, though that maybe wouldn't hurt
too much).
Enterprise Ruby maybe should mess with fixed ruby heap chunk sizes to
allow more RAM to be returned to the OS [?]
Take care.

Xdmx Xdmx

unread,
Apr 22, 2008, 4:08:28 PM4/22/08
to rubyonra...@googlegroups.com
Hongli Lai wrote:
> On Apr 15, 9:06�pm, Xdmx Xdmx <rails-mailing-l...@andreas-s.net>
> wrote:
> Hi Xdmx.
>
> Sorry for the late reply, we've been getting swamped with work lately,
> and I haven't had time to reply until today.


Hi, thanks for every answers :)
Just the last one.
What happen if there are 3 apps with 3 different rails versions
(freezed)? Will be 3 different framework handlers for each version or
less because they merge some common stuff (actually this one would be
very hard i think)?
Ok, this is the real last one, is it the same to have rails freezed or
used the one installed in the system? or does mod_rails works
differently (as performance or others)?
Thanks :)

Ok....this is really really the last :) Will your ruby branch be
available like a gem or some other ways ? (= something really fast to
install and config which would not compromise everything in the worst
case...like mod_rails :) )

Hongli Lai

unread,
Apr 28, 2008, 1:50:03 PM4/28/08
to Ruby on Rails: Talk
On Apr 22, 10:08 pm, Xdmx Xdmx <rails-mailing-l...@andreas-s.net>
wrote:
> Hi, thanks for every answers :)
> Just the last one.
> What happen if there are 3 apps with 3 different rails versions
> (freezed)? Will be 3 different framework handlers for each version

Yes.

> or
> less because they merge some common stuff (actually this one would be
> very hard i think)?

No magical merging happens. That's pretty much impossible to pull off.

> Ok, this is the real last one, is it the same to have rails freezed or
> used the one installed in the system? or does mod_rails works
> differently (as performance or others)?
> Thanks :)

No. If you use a system-wide Rails gem, then different Rails
applications will be able to share the framework code. If you freeze
Rails (vendorize it) then that's not possible, and each application
will use its own framework.

> Ok....this is really really the last :) Will your ruby branch be
> available like a gem or some other ways ? (= something really fast to
> install and config which would not compromise everything in the worst
> case...like mod_rails :) )

We'll provide an easy-to-use installer. ;) A lot of emphasis will be
on "easy".

rogerdpack

unread,
Apr 28, 2008, 8:01:22 PM4/28/08
to Ruby on Rails: Talk
Some people believe mod_rails would be better served by using rack

...

yeah the idea is for this to be merged into rails proper once it is
complete and tested, the core team knows of my work and says it will
make it in once it is done. As far as mod_rails goes... I think they
made a huge mistake by not using rack as their interface, so I'd hope
they will realize this and add rack support. mod_rubinius is all rack
based and will be able to run any ruby framework or simple rack
handlers you can throw at it.
...
-Ezra
http://brainspl.at/articles/2008/04/25/hey-rails-nice-rack

Roger Pack

unread,
May 15, 2008, 11:48:39 AM5/15/08
to rubyonra...@googlegroups.com
ChessMess wrote:
> http://modrails.com/
>
> Mod_Rails is out, so what do you think?

Nirvana would be, seeing as you can limit it to say 4 processes per
rails app.
Say you get 16 simultaneous requests--nirvana would be that they would
all get sent to the same apache threads, so that it didn't unnecessarily
use up apache threads all waiting on rails' existing processes to
finish. Like a flood to a single rails app wouldn't distract from other
traffic.
That would be awesome! I'd be able to sleep at night knowing rails is
not hurting others on my shared host.
-R

Hongli Lai

unread,
May 17, 2008, 1:30:46 PM5/17/08
to Ruby on Rails: Talk
On May 15, 5:48 pm, Roger Pack <rails-mailing-l...@andreas-s.net>
wrote:
> Nirvana would be, seeing as you can limit it to say 4 processes per
> rails app.
> Say you get 16 simultaneous requests--nirvana would be that they would
> all get sent to the same apache threads, so that it didn't unnecessarily
> use up apache threads all waiting on rails' existing processes to
> finish.  Like a flood to a single rails app wouldn't distract from other
> traffic.
> That would be awesome!  I'd be able to sleep at night knowing rails is
> not hurting others on my shared host.

You can. In the development version.

Roger Pack

unread,
May 17, 2008, 3:47:23 PM5/17/08
to rubyonra...@googlegroups.com
>> Say you get 16 simultaneous requests--nirvana would be that they would
>> all get sent to the same apache threads, so that it didn't unnecessarily
>> use up apache threads all waiting on rails' existing processes to
>> finish. �Like a flood to a single rails app wouldn't distract from other
>> traffic.
> You can. In the development version.
Wow. Rock on! Now my only remaining wish would that it would
[seamlessly] restart threads if they grow too large RAM-wise.
Thanks!
-r

Rick Williams

unread,
Jul 3, 2008, 4:12:45 PM7/3/08
to rubyonra...@googlegroups.com
Hongli Lai wrote:

> If the FrameworkSpawner is running, then spawning time will decrease
> significantly. The framework will not have to be loaded at all - only
> the application code will have to be loaded.

Is there a way to force a FrameworkSpawner to start when Apache starts?

Would you need one or multiple instances?

Is there a inactivity timeout on the FrameworkSpawner once started?

Richard

Reply all
Reply to author
Forward
0 new messages