# How to increase the time-out

**URL:** <https://www.ruby-forum.com/t/how-to-increase-the-time-out/195183>\
**Category:** Rails\
**Created:** [September 18, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/how-to-increase-the-time-out/195183 "2010-09-18T14:59:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [September 18, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/how-to-increase-the-time-out/195183/1 "2010-09-18T14:59:33Z")

</div>

I have a Rails 2 app that doesn’t get a lot of traffic. It’s running  
under Passenger and Apache 2.2, and when it’s running, it has great  
performance, page loads are very snappy, etc. But the first hit on the  
site after the server has gone to sleep takes a good while to load,  
right on the edge of “hmmm, server isn’t responding…”.

Is there something I can do, short of a cron job to request the home  
page every couple of minutes, to keep this spin-down from happening?

Thanks,

Walter

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [September 18, 2010, 4:13pm UTC](https://www.ruby-forum.com/t/how-to-increase-the-time-out/195183/2 "2010-09-18T16:13:52Z")

</div>

On Sat, Sep 18, 2010 at 5:58 AM, Walter Lee D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have a Rails 2 app that doesn’t get a lot of traffic. It’s running under  
> Passenger and Apache 2.2, and when it’s running, it has great performance,  
> page loads are very snappy, etc. But the first hit on the site after the  
> server has gone to sleep takes a good while to load, right on the edge of  
> “hmmm, server isn’t responding…”.
> 
> Is there something I can do, short of a cron job to request the home page  
> every couple of minutes, to keep this spin-down from happening?

I would install NewRelic or equiv to see where the time’s being spent.

My guess would be a DB pool connection timeout; re-establishing the  
first connection is fairly time-consuming.

## HTH!

Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [September 18, 2010, 6:39pm UTC](https://www.ruby-forum.com/t/how-to-increase-the-time-out/195183/3 "2010-09-18T18:39:37Z")

</div>

Walter Lee D. wrote:

> Walter

Take a look at the passenger documentation. After a configurable idle  
period the rails process is terminated and must be reloaded. The length  
of the idle period can be set to whatever works for you. There are some  
other things that can be similarly changed that will impact this.

Norm

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [September 19, 2010, 9:53am UTC](https://www.ruby-forum.com/t/how-to-increase-the-time-out/195183/4 "2010-09-19T09:53:46Z")

</div>

Passenger 3 will have MinInstances option so you could say that you  
always want at least 1 instance ready to serve next request.

Robert Pankowecki
