# RE: Production deployment on Dreamhost?

**URL:** <https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098>\
**Category:** Rails\
**Created:** [January 12, 2006, 10:07pm UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098 "2006-01-12T22:07:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [January 12, 2006, 10:07pm UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098/1 "2006-01-12T22:07:04Z")

</div>

Yup just figured that out…

Do you think that this would solve the issue where my app sometimes  
takes 30-40 seconds to “start up” after it’s not been used for awhile?  
I’d hate for a client website to have to wait that long to serve up a  
search page or something.

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [January 12, 2006, 10:10pm UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098/2 "2006-01-12T22:10:08Z")

</div>

I face the same think when using rails on dreamhost with fcgi. The app  
needs to startup sometimes (and this takes a lot of cpu time)…

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [January 13, 2006, 1:42am UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098/3 "2006-01-13T01:42:08Z")

</div>

Abdur-Rahman A. wrote:

> I face the same think when using rails on dreamhost with fcgi. The app  
> needs to startup sometimes (and this takes a lot of cpu time)…

I’m not sure about deployment on Dreamhost, but if I remember correctly  
I think there are maintenance things that you can do on your app to keep  
it running up to speed.

I’m still noobish with Rails, but I think I read something about  
clearing your logs and files like that to keep Rails apps running  
faster.

Might be an aside to the question, but I remembered it and thought it  
might be of note for other new Railers. Anyone have any more  
details/specifics on what I am talking about?

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [January 13, 2006, 3:24am UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098/4 "2006-01-13T03:24:57Z")

</div>

On Jan 12, 2006, at 3:05 PM, Hogan, Brian P. wrote:

> Yup just figured that out…
> 
> Do you think that this would solve the issue where my app sometimes  
> takes 30-40 seconds to “start up” after it’s not been used for awhile?  
> I’d hate for a client website to have to wait that long to serve up a  
> search page or something.

This has come up several times on the list recently. The problem seems  
to be that the fcgi processes get paged out of memory after a while,  
causing a delay when they get swapped back in. A workaround would be to  
set up a cron job that uses wget to hit your site every few minutes.  
This’ll keep the process in memory so it’ll be more responsive. I  
haven’t  
had this problem myself, so I’m just parroting what I’ve heard  
elsewhere.  
YMMV.

-dudley

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [January 13, 2006, 5:46am UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098/5 "2006-01-13T05:46:30Z")

</div>

Dudley F. wrote:

> This has come up several times on the list recently. The problem seems  
> to be that the fcgi processes get paged out of memory after a while,  
> causing a delay when they get swapped back in. A workaround would be to  
> set up a cron job that uses wget to hit your site every few minutes.  
> This’ll keep the process in memory so it’ll be more responsive. I haven’t  
> had this problem myself, so I’m just parroting what I’ve heard elsewhere.  
> YMMV.

There was a thread “Idle Apache+FastCGI sleeping?” in which Ezra  
Zygmuntowicz gave this advice:

I have seen this behavior before. It seems to me that when the  
fcgi’s sit idle for too long they get paged out of memory. Then when  
you hit the site after its been idle, the fcgi’s have to page back  
into memory so hence the lag. The kludge that I use works great but  
I’d be interested if there was another way. But this technique works  
great in production for me.

Just add a cron job that uses curl or wget to grab a page thats not  
cached(so it goes through rails) and send the output to /dev/null. If  
you have the cron job do this once every 5 minutes your fcgi’s will  
always be ‘awake’ . And one hit every 5 minutes is virtually no extra  
load on the server. But by doing things this way, your site will  
always be snappy no matter how long it has been since a user visited  
the site.

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [January 13, 2006, 5:49am UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098/6 "2006-01-13T05:49:31Z")

</div>

I think Ezra should have a cron job to send out that email every 10  
days…  
it seems to be a common problem.

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [January 13, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098/7 "2006-01-13T18:56:35Z")

</div>

On Jan 12, 2006, at 8:49 PM, Tom F. wrote:

> I think Ezra should have a cron job to send out that email every 10  
> days…  
> it seems to be a common problem.

Great Idea! lol

-Ezra

> > elsewhere.  
> > great in production for me.  
> > Rails mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

-Ezra Z.  
Yakima Herald-Republic  
WebMaster  
[http://yakimaherald.com](http://yakimaherald.com)  
509-577-7732  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [January 17, 2006, 3:07am UTC](https://www.ruby-forum.com/t/re-production-deployment-on-dreamhost/95098/8 "2006-01-17T03:07:34Z")

</div>

Good info here guys. I just deployed on Dreamhost as well, and  
everything  
ain’t so “dreamy”. Hopefully these fixes will speed things up.

Are you guys freezing edge or anything on there? I noticed on my box at  
least they were running an older version of rails. 0.14.3 I believe.
