Forum: Ruby on Rails Mod_Rails Released - Post your Thoughts

Posted by ChessMess (Guest)
on 2008-04-11 21:22
(Received via mailing list)
http://modrails.com/

Mod_Rails is out, so what do you think?
Posted by James Byrne (byrnejb)
on 2008-04-11 21:26
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 by Nathan Esquenazi (xgamerx)
on 2008-04-11 23:23
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.
Posted by Sam Granieri (Guest)
on 2008-04-11 23:43
(Received via mailing list)
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.
Posted by DyingToLearn (Guest)
on 2008-04-12 02:41
(Received via mailing list)
This looks great. Would one ever use this in a development/testing
environment?

Thanks
Posted by John Harrison (mr_shine)
on 2008-04-12 03:55
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.
Posted by Rahil Kumar (rahil)
on 2008-04-12 14:16
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.


Posted by Phillip Koebbe (pkoebbe)
on 2008-04-12 16:40
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
Posted by Bill Walton (Guest)
on 2008-04-12 16:55
(Received via mailing list)
Exceptional!  Any chance we'll see a Windows executable, maybe 
packageable
with Instant Rails?

Best regards,
Bill
Posted by felipekk@gmail.com (Guest)
on 2008-04-12 23:14
(Received via mailing list)
I think this is one of the best things to happen to RoR lately.
Posted by Warlock handleR (warlock_handler)
on 2008-04-13 01:03
wowwwwwwwwwwwwwwwwwwwwwwwwwwwwwww i seen this a day late... but still 
wowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

anyone who has tried it... can post some reviews?
Posted by William Li (william312)
on 2008-04-13 12:39
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
Posted by DyingToLearn (Guest)
on 2008-04-13 22:20
(Received via mailing list)
@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 by William Li (william312)
on 2008-04-14 07:16
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 by AtsoK (Guest)
on 2008-04-14 07:46
(Received via mailing list)
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?
Posted by John Honovich (jr1734)
on 2008-04-14 08:43
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?
Posted by Pratik Naik (pratik)
on 2008-04-14 13:27
(Received via mailing list)
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

On Sun, Apr 13, 2008 at 11:39 AM, William Li
<rails-mailing-list@andreas-s.net> wrote:
>
>  something?).
>  http://www.hostingrails.com/mod_rails_hosting
>
> --
>  Posted via http://www.ruby-forum.com/.
>
>  >
>



--
Cheers!
- Pratik
http://m.onkey.org
Posted by Hongli Lai (Guest)
on 2008-04-14 14:42
(Received via mailing list)
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)
Posted by machdudas@googlemail.com (Guest)
on 2008-04-14 18:18
(Received via mailing list)
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
Posted by Jeremy McAnally (Guest)
on 2008-04-14 20:58
(Received via mailing list)
It shares code even if I vendor Rails?

--Jeremy

On Mon, Apr 14, 2008 at 7:26 AM, Pratik <pratiknaik@gmail.com> wrote:
>  make that information a bit more clear :)
>  >
>  >  1) The app fired up in a Mongrel instance uses 35MB RES.
>  >
>  >
>  - Pratik
>  http://m.onkey.org
>
>
>
>  >
>



--
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
Posted by Xdmx Xdmx (xdmx)
on 2008-04-14 21:13
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
Posted by Hongli Lai (Guest)
on 2008-04-15 00:59
(Received via mailing list)
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.
Posted by Hongli Lai (Guest)
on 2008-04-15 01:06
(Received via mailing list)
On Apr 14, 9:13 pm, Xdmx Xdmx <rails-mailing-l...@andreas-s.net>
wrote:
> 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

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
Posted by Chris Olsen (chrisolsen)
on 2008-04-15 08:38
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

Posted by Roger Pack (rogerdpack)
on 2008-04-15 08:53
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
Posted by Conrad Taylor (Guest)
on 2008-04-15 09:17
(Received via mailing list)
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
Posted by Roger Pack (rogerdpack)
on 2008-04-15 16:43
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!
-R
Posted by Xdmx Xdmx (xdmx)
on 2008-04-15 21:06
Hongli Lai 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

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 :)
Posted by Roger Pack (rogerdpack)
on 2008-04-15 21:21
> 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
Posted by Xdmx Xdmx (xdmx)
on 2008-04-15 21:36
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
Posted by Roger Pack (rogerdpack)
on 2008-04-15 21:43
> 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.
Posted by Roger Pack (rogerpack)
on 2008-04-17 03:15
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
Posted by Roger Pack (rogerpack)
on 2008-04-17 19:10
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.
-R
Posted by Hongli Lai (Guest)
on 2008-04-19 23:06
(Received via mailing list)
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
Posted by Hongli Lai (Guest)
on 2008-04-19 23:09
(Received via mailing list)
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.

With kind regards,
Hongli Lai
- phusion.nl
Posted by Hongli Lai (Guest)
on 2008-04-19 23:10
(Received via mailing list)
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.
Posted by Hongli Lai (Guest)
on 2008-04-19 23:18
(Received via mailing list)
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.

With kind regards,
Hongli Lai
- phusion.nl
Posted by Hongli Lai (Guest)
on 2008-04-19 23:20
(Received via mailing list)
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.
Posted by Hongli Lai (Guest)
on 2008-04-19 23:22
(Received via mailing list)
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. :)
Posted by Roger Pack (rogerpack)
on 2008-04-20 05:28
>> 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.
-R
Posted by Xdmx Xdmx (xdmx)
on 2008-04-22 22:08
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 :) )
Posted by Hongli Lai (Guest)
on 2008-04-28 19:51
(Received via mailing list)
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".
Posted by Roger Pack (rogerdpack)
on 2008-04-29 02:02
(Received via mailing list)
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
Posted by Roger Pack (rogerpack)
on 2008-05-15 17:48
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
Posted by Hongli Lai (Guest)
on 2008-05-17 19:31
(Received via mailing list)
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.
Posted by Roger Pack (rogerdpack)
on 2008-05-17 21:47
>> 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
Posted by Rick Williams (rick)
on 2008-07-03 22:12
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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.