# Question about updating files in production / Mongrel restart

**URL:** <https://www.ruby-forum.com/t/question-about-updating-files-in-production-mongrel-restart/178572>\
**Category:** Rails\
**Created:** [November 6, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/question-about-updating-files-in-production-mongrel-restart/178572 "2009-11-06T17:59:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MJFuzz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@MJFuzz](https://www.ruby-forum.com/u/MJFuzz)\
**Post date:** [November 6, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/question-about-updating-files-in-production-mongrel-restart/178572/1 "2009-11-06T17:59:55Z")

</div>

Hello,

I just completed my first real rails application. I successfully  
deployed it, configured apache/mongrel clusters, etc. However, I do  
need to make code changes on the site often. I noticed the only time  
the change takes effect is when mongrel is recycled. Is there anyway  
around that? I know best practice is to do scheduled updates…etc.  
But this s a small site that will have need frequent updates. I read  
up on Capistrano a bit, but it seems that part of its steps is a  
mongrel restart. Is this really the only way?

Thanks!

---

<div class="post-metadata">

**Author:** ![MJFuzz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@MJFuzz](https://www.ruby-forum.com/u/MJFuzz)\
**Post date:** [November 6, 2009, 6:26pm UTC](https://www.ruby-forum.com/t/question-about-updating-files-in-production-mongrel-restart/178572/2 "2009-11-06T18:26:16Z")

</div>

On Fri, Nov 6, 2009 at 5:58 PM, MJFuzz [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> mongrel restart. Is this really the only way?

## I don’t think you have another choice if you’re using mongrel, however, I’ve never deployed mongrel clusters, always used passenger.

Leonardo M…  
There’s no place like ~

---

<div class="post-metadata">

**Author:** ![MJFuzz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@MJFuzz](https://www.ruby-forum.com/u/MJFuzz)\
**Post date:** [November 6, 2009, 6:35pm UTC](https://www.ruby-forum.com/t/question-about-updating-files-in-production-mongrel-restart/178572/3 "2009-11-06T18:35:03Z")

</div>

In production mode, the classes are all cached on load. This is for  
performance reasons. In development mode, the classes are reloaded on  
each request which enables you to see your changes immediately. That  
being said, changes to routes or the environment files would still not  
reload. Generally speaking restarting your mongrel/passenger  
instances is the best approach. If you are less concerned for  
performance you could run in production with caching disabled, though  
I would advise against it. Even for a small site, Capistrano is  
simply to setup & well worth doing. Also, dump Mongrel & use  
Enterprise Ruby & passenger… it is so much less of a headache to  
manage for deploys & manages memory much better you’ll appreciate the  
change.

Niels

---

<div class="post-metadata">

**Author:** ![MJFuzz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@MJFuzz](https://www.ruby-forum.com/u/MJFuzz)\
**Post date:** [November 6, 2009, 7:27pm UTC](https://www.ruby-forum.com/t/question-about-updating-files-in-production-mongrel-restart/178572/4 "2009-11-06T19:27:10Z")

</div>

great! i will look at that. Thanks!

---

<div class="post-metadata">

**Author:** ![MJFuzz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@MJFuzz](https://www.ruby-forum.com/u/MJFuzz)\
**Post date:** [November 7, 2009, 4:34pm UTC](https://www.ruby-forum.com/t/question-about-updating-files-in-production-mongrel-restart/178572/5 "2009-11-07T16:34:17Z")

</div>

MJFuzz wrote:

> Hello,
> 
> I just completed my first real rails application. I successfully  
> deployed it, configured apache/mongrel clusters, etc. However, I do  
> need to make code changes on the site often.

Just checking: you are using decent version control, right?

> I noticed the only time  
> the change takes effect is when mongrel is recycled. Is there anyway  
> around that? I know best practice is to do scheduled updates…etc.

That’s not necessarily a best practice.

> But this s a small site that will have need frequent updates. I read  
> up on Capistrano a bit, but it seems that part of its steps is a  
> mongrel restart. Is this really the only way?

Just about. But why should it worry you? At least with Passenger, an  
app restart only takes a few seconds.

And if you’re not using Capistrano yet…set it up right away! 🙂

> Thanks!

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
