# Mongrel\_cluster and radiant

**URL:** <https://www.ruby-forum.com/t/mongrel-cluster-and-radiant/88679>\
**Category:** Radiant CMS\
**Created:** [March 13, 2007, 2:41pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-and-radiant/88679 "2007-03-13T14:41:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nancy\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/90db22/32.png) [@Nancy\_C](https://www.ruby-forum.com/u/Nancy_C)\
**Post date:** [March 13, 2007, 2:41pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-and-radiant/88679/1 "2007-03-13T14:41:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nancy\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/90db22/32.png) [@Nancy\_C](https://www.ruby-forum.com/u/Nancy_C)\
**Post date:** [March 13, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-and-radiant/88679/2 "2007-03-13T15:08:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nancy\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/90db22/32.png) [@Nancy\_C](https://www.ruby-forum.com/u/Nancy_C)\
**Post date:** [March 13, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-and-radiant/88679/3 "2007-03-13T16:58:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nancy\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/90db22/32.png) [@Nancy\_C](https://www.ruby-forum.com/u/Nancy_C)\
**Post date:** [March 13, 2007, 7:15pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-and-radiant/88679/4 "2007-03-13T19:15:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Nancy\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/90db22/32.png) [@Nancy\_C](https://www.ruby-forum.com/u/Nancy_C)\
**Post date:** [March 14, 2007, 11:03am UTC](https://www.ruby-forum.com/t/mongrel-cluster-and-radiant/88679/5 "2007-03-14T11:03:08Z")

</div>

Hi Kevin,

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

Best regards,  
N.

Kevin A. schrieb:

---

<div class="post-metadata">

**Author:** ![Nancy\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/90db22/32.png) [@Nancy\_C](https://www.ruby-forum.com/u/Nancy_C)\
**Post date:** [March 13, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-and-radiant/88679/6 "2007-03-13T18:01:01Z")

</div>

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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
