Mongrel_cluster and radiant

Hi Everybody,

I am trying to figure out how to best go about using one radiant
install, and redirecting urls for several (separate) radiant instance
databases.

I can redirect through apache (2.2 w/ proxy_balancer and
mongrel_cluster) directly to the instance of radiant, and then configure
2 mongrels for each instance. Problem is, mongrels (mine, anyway) are
hungry little beasts snarfing 100M per meal, implying that I can only
run 6-8 “customers” per server on my single and lonely GB RAM. I dunno,
but good sense tells me this can’t be the recommended way…

Is there a way to use one radiant installation and switch dynamically
between different mysql databases?

I’d be grateful for ideas or pointers.

Thanks in advance,
Nancy C.

Your mongrels should not be taking that much memory. Are you running
them in production mode? Also consider that unless your sites are
really heavily and frequently viewed, you may need only one mongrel per
site.

Sean

Sean C. schrieb:

Your mongrels should not be taking that much memory. Are you running
them in production mode? Also consider that unless your sites are
really heavily and frequently viewed, you may need only one mongrel per
site.

Sean

Hi Sean,

Thanks for your answer. Hmmm. Yes, the mongrels are running in
production mode. Approximately how much memory should each be needing
then?

ps aux shows:

root 7896 0.0 3.7 82192 38148 ? Sl 14:24 0:01
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8002
-a 127.0.0.1 -P
root 7899 0.0 3.7 82192 38140 ? Sl 14:24 0:01
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8003
-a 127.0.0.1 -P
root 7903 0.0 4.6 90352 48156 ? Sl 14:24 0:01
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8000
-a 127.0.0.1 -P
root 7906 0.0 4.6 90360 48160 ? Sl 14:24 0:01
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8001
-a 127.0.0.1 -P
root 7912 0.0 3.7 82184 38140 ? Sl 14:24 0:01
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8004
-a 127.0.0.1 -P
root 7915 0.0 3.7 82192 38152 ? Sl 14:24 0:01
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8005
-a 127.0.0.1 -P

I have restarted mongrel just now and the consumption is much less
(between 3.7% and 4.6% each at 1GB RAM). Yesterday (after running a few
days all of the mongrel processes were over 5%).

Not to wander off into a mongrel discussion, although I would be very
interested in your answer, is this then (1 mongrel per database) the
recommended way to do it at this point?

It’s ok, but I wanted to check if there was, maybe a better way…

best regards,
Nancy

I know nothing about Mongrel, and I’ve never looked at the memory
footprint of Radiant running anywhere…

But, just based on what I know about what Radiant DOES, it shouldn’t
really be taking up that much more memory than any other rails app,
right?

Here’s my thinking:
If you’re not doing anything in the admin, then the work that Radiant
actually does is pretty minimal. For the most part, It’s just fetching
cached pages.

I suggest you run a “Hello World” rails app on your hosting environment,
and compare the memory footprint.

The next thing to consider is, what is Radiant keeping in memory? (i.e.
what can you make Radiant stop keeping in memory so that you have a
smaller footprint)

Sesssions? is it storing anything about sessions in memory? How else
can you tell what is being stored in memory?

Is it just the size of the codebase that’s the main factor here? If you
download a buncha plugins and make sure they load into Radiant but don’t
do anything, does this change your memory footprint?

Hi Kevin,

This, from the mongrel mailing list looked interesting to us:
http://rubyforge.org/pipermail/mongrel-users/2007-March/003231.html

Best regards,
N.

Kevin A. schrieb:

Hi,

I’d be quite interested if there was any way to reduce memory usage too,
here’s the details for a couple of mongrel clusters, both of these are
running on a 256MB slices from slicehost so memory usage is a bit of a
concern, especially as neither of these sites have been made live and
have
enough traffic to repay their hosting costs.

Highly modified pre-mental instance with no caching:

root 24008 0.5 29.5 144004 76996 ? Sl 16:38 0:04
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8000
-a
127.0.0.1
root 24011 0.7 18.0 113764 47124 ? Sl 16:38 0:05
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8001
-a
127.0.0.1
root 24014 0.6 27.9 139460 72788 ? Sl 16:38 0:05
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8002
-a
127.0.0.1

Fairly standard mental branch with a few extensions:

root 15373 0.0 21.8 123512 57032 ? Sl Mar12 0:06
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8000
-a
127.0.0.1
root 15376 0.0 21.3 124608 55804 ? Sl Mar12 0:08
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8001
-a
127.0.0.1
root 15379 0.0 20.1 120332 52660 ? Sl Mar12 0:06
/usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8002
-a
127.0.0.1

Best Regards,
Kevin A.

On 3/13/07, Nancy C. [email protected] wrote:

Sean C. schrieb:

Your mongrels should not be taking that much memory. Are you running
them in production mode? Also consider that unless your sites are
really heavily and frequently viewed, you may need only one mongrel per
site.

Sean


BN23 Search Limited is Registered in England
Company Number: 5323555
VAT registration Number: 896 69 0062

BN23 Search Limited
Temple Grove
Compton Place Road
Eastbourne
East Sussex
BN20 8AD

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs