# Deploying RoR - Advice seeked!

**URL:** <https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616>\
**Category:** Rails\
**Created:** [March 30, 2007, 12:04pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616 "2007-03-30T12:04:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 30, 2007, 12:04pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/1 "2007-03-30T12:04:49Z")

</div>

Hi everyone!

I am developping a Ruby on Rails website with a heavy calculation  
component at the backend. The calculation module can take up to 30sec  
to produce a result and therefore the queries can be extremely slow to  
be answered.

I now want to deploy my website and I am having a hard time finding a  
good setup for it. I’ve tried the following two options and I’ll  
explain the problems I’ve had using them. I’m looking for suggestions  
for either solving these problems or for a deployement environment  
that would suit my needs.

Setup 1. Apache2  
Problem: It seems that all the StdOut and StdErr are directly send to  
apache, causing it to produce erroneous requests. Also all my logs are  
therefore empty and it is not that great to find out about the general  
status of the application or the errors that occur.

Setup 2: Apache2 + Mongrel cluster  
Problem: Mongrel is not multithreaded and as I’ve stated earlier my  
requests can take up to 30sec. So if I want to guarantee a fast  
service for my users I’d need a ridiculous number of mongrels running.

I’ll be glad to give more precisions if needed and would appreciate  
any suggestions or advice!

Thanks alot,  
Laurent

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 30, 2007, 12:29pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/2 "2007-03-30T12:29:51Z")

</div>

On 3/30/07, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi everyone!
> 
> I am developping a Ruby on Rails website with a heavy calculation  
> component at the backend. The calculation module can take up to 30sec  
> to produce a result and therefore the queries can be extremely slow to  
> be answered.

[…]

> I’ll be glad to give more precisions if needed and would appreciate  
> any suggestions or advice!

Run that task in the background, using for instance BackgroundDRb  
[http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/).

Isak

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 30, 2007, 5:53pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/3 "2007-03-30T17:53:09Z")

</div>

Thanks a lot for this. I will definitely look into it since it seems  
to be great solution for our problem.  
About it, I see it’s version 0.2; has anyone experience with it and  
can tell me a bit more about its stability/reliability?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 30, 2007, 7:51pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/4 "2007-03-30T19:51:33Z")

</div>

Laurent,

I’ve used it to handle some slow jobs before and it has been great.  
One recomendation I can give you is to try out Litespeed instead of  
Apache or Mongrel. The performance is great and the admin interface  
makes your life easier. Give it a try before trying backgroundDrb and  
see how it goes.

Sincerely,

Adrian Marid

On 3/30/07, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > any suggestions or advice!

–  
Adrian Esteban Madrid

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 2, 2007, 5:35pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/5 "2007-04-02T17:35:47Z")

</div>

Laurent,

Why don’t you extend your Ruby with a little C code. This can be a  
great way to get a performance gain. The picaxe book has a great  
chapter called Extending Ruby that talks all about it. It is Chapter  
21 and starts on page 275. This will place your computation in  
compiled C, and therefore will run much faster. Let me know if this  
works for you.

Amos

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 2, 2007, 9:29am UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/6 "2007-04-02T09:29:30Z")

</div>

Thanks Adrian!

A friend of mine actually pointed out Litespeed as a possible option  
too and I am going to give it a try. Maybe even use it in conjunction  
with backgroundDrb.

I will try this during this week and post the results I experience.

Laurent

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 16, 2007, 12:13pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/7 "2007-04-16T12:13:11Z")

</div>

Hi Amos,

Good suggestion. The problem with this computation phase is that an  
important part (~70%) of the time is spent downloading data from  
foreign sources and therefore cannot really benefit from your  
proposition. I’ll have to see how much I can benefit from a rewrite of  
the code in C.

I’ve had to postpone this deployement problem until now and I will  
post the results I obtain with the different solution suggested soon.

Thanks to all of you!  
Laurent

On Apr 2, 5:34 pm, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 16, 2007, 1:05pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/8 "2007-04-16T13:05:08Z")

</div>

Another vote for backgroundrb for me.  
As far as rewriting stuff to use C, you might want to check out Ruby  
Inline [http://rubyforge.org/projects/rubyinline/](http://rubyforge.org/projects/rubyinline/) Depending on the  
size/complexity of your code you might find it useful.

Fred

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 17, 2007, 5:29pm UTC](https://www.ruby-forum.com/t/deploying-ror-advice-seeked/90616/9 "2007-04-17T17:29:41Z")

</div>

Thanks Frederick!

I’m exploring the backgroundrb at the moment and will post soon (I  
really will when I find a good solution :o)) the results I get.

Thanks for your pointer to the rubyinline project. It indeed seems  
like it can be very useful. I’ve decided to profile my application and  
see where the time is spent before rewritting anything in another  
language. But if it turns out I have to rewrite some parts then I’ll  
definitely consider this lib.

Laurent

On 16 avr, 13:05, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
