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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sat, Sep 18, 2010 at 5:58 AM, Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> 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 Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis 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? > > Thanks, > > 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.