Hi, I set up my personal site (todo''s, contacts, etc.) on Dreamhost. I am the only one who accesses the site. It''s in production mode and it runs on dispatch.fcgi. The problem is... When I visit the site, the first page takes long time (about 30 sec) to load. The next page (or the same first page) loads pretty fast once the first page is loaded. And if I visit the site after 1 hour, the page takes long time again. I guess that application is cached but it loses the cache after some idle time. How can I narrow down the problem area and fix it? Thanks. Sam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Nov-29 21:28 UTC
Re: Page loads very slowly on Dreamhost after some idle time
On 29 Nov 2007, at 21:27, Sam Kong wrote:> > Hi, > > I set up my personal site (todo''s, contacts, etc.) on Dreamhost. > I am the only one who accesses the site. > It''s in production mode and it runs on dispatch.fcgi.Are the dispatch.fcgis dying/getting killed when they are inactive for too long ? Fred --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sam Kong
2007-Nov-29 21:35 UTC
Re: Page loads very slowly on Dreamhost after some idle time
Hi, Frederick Cheung wrote:> On 29 Nov 2007, at 21:27, Sam Kong wrote: > >> >> Hi, >> >> I set up my personal site (todo''s, contacts, etc.) on Dreamhost. >> I am the only one who accesses the site. >> It''s in production mode and it runs on dispatch.fcgi. > > Are the dispatch.fcgis dying/getting killed when they are inactive for > too long ? > > FredNo. 4 or 5 dispatch.fcgi''s are still there. However, if I request a page, the dispatch.fcgi''s are replaced with new one (PID''s are different). Any idea? Thanks. Sam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Nov-29 21:40 UTC
Re: Page loads very slowly on Dreamhost after some idle time
On 29 Nov 2007, at 21:35, Sam Kong wrote:> > Hi, > > Frederick Cheung wrote: >> On 29 Nov 2007, at 21:27, Sam Kong wrote: >> >>> >>> Hi, >>> >>> I set up my personal site (todo''s, contacts, etc.) on Dreamhost. >>> I am the only one who accesses the site. >>> It''s in production mode and it runs on dispatch.fcgi. >> >> Are the dispatch.fcgis dying/getting killed when they are inactive >> for >> too long ? >> >> Fred > > No. 4 or 5 dispatch.fcgi''s are still there. > However, if I request a page, the dispatch.fcgi''s are replaced with > new > one (PID''s are different).Well if for whatever reason you end up getting a request server by a new dispatch.fcgi that will slow things down, since booting the rails environment takes some time, and obviously none of your code is cached. This is probably a magic fast-cgi problem. I''ve moved away from using that a long time ago, so no clue on why this is happening. Fred --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sam Kong
2007-Nov-29 21:43 UTC
Re: Page loads very slowly on Dreamhost after some idle time
Frederick Cheung wrote:> On 29 Nov 2007, at 21:35, Sam Kong wrote: > >>>> I am the only one who accesses the site. >> new >> one (PID''s are different). > > Well if for whatever reason you end up getting a request server by a > new dispatch.fcgi that will slow things down, since booting the rails > environment takes some time, and obviously none of your code is > cached. This is probably a magic fast-cgi problem. I''ve moved away > from using that a long time ago, so no clue on why this is happening. > > FredThank you for the explanation. Do you know if there''s an alternative to fast-cgi on Dreamhost? Sam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Nov-29 21:44 UTC
Re: Page loads very slowly on Dreamhost after some idle time
On 29 Nov 2007, at 21:43, Sam Kong wrote:> > Frederick Cheung wrote: >> On 29 Nov 2007, at 21:35, Sam Kong wrote: >> >>>>> I am the only one who accesses the site. >>> new >>> one (PID''s are different). >> >> Well if for whatever reason you end up getting a request server by a >> new dispatch.fcgi that will slow things down, since booting the rails >> environment takes some time, and obviously none of your code is >> cached. This is probably a magic fast-cgi problem. I''ve moved away >> from using that a long time ago, so no clue on why this is happening. >> >> Fred > > Thank you for the explanation. > Do you know if there''s an alternative to fast-cgi on Dreamhost?I don''t even really know what Dreamhost is, so no. Fred> > > Sam > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
White Wizzard
2007-Nov-29 21:58 UTC
Re: Page loads very slowly on Dreamhost after some idle time
are your threads fro dream host falling asleep? I had that issue with mongrel on ubuntu White Wizzard On Nov 29, 4:44 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 29 Nov 2007, at 21:43, Sam Kong wrote: > > > > > > > Frederick Cheung wrote: > >> On 29 Nov 2007, at 21:35, Sam Kong wrote: > > >>>>> I am the only one who accesses the site. > >>> new > >>> one (PID''s are different). > > >> Well if for whatever reason you end up getting a request server by a > >> new dispatch.fcgi that will slow things down, since booting the rails > >> environment takes some time, and obviously none of your code is > >> cached. This is probably a magic fast-cgi problem. I''ve moved away > >> from using that a long time ago, so no clue on why this is happening. > > >> Fred > > > Thank you for the explanation. > > Do you know if there''s an alternative to fast-cgi on Dreamhost? > > I don''t even really know what Dreamhost is, so no. > > Fred > > > > > Sam > > -- > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
HiddenBek
2007-Nov-29 22:39 UTC
Re: Page loads very slowly on Dreamhost after some idle time
The only alternative that I''m aware of is regular cgi, which is even slower. Dreamhost greatly oversells their capacity and must kill off processes constantly to keep resource usage down. The best solution is to switch to a decent host, but running a cron job that hits your site every 5 minutes should keep a dispatch.fcgi ready to go most of the time. Heavy page caching will make a big difference of course. Cached pages are served entirely by apache, so Rails environment startup time isn''t a factor. This is a tricky subject though, and probably isn''t worth bothering with just to save a few bucks a month on web hosting. Dreamhost will happily kill dispatch.fcgi in the middle of a request, leading to intermittent 500 errors. I wrote a plugin in to correct this. Install it with: script/plugin install http://hg.rubyinspace.com/public/plugins/file/tip/impolite_host/ Be sure to look at the README. This plugin interferes with webrick or mongrel, so it''s disabled by default. A small change to dispatch.fcgi is required to turn it on. This plugin is similar to the dreamhost plugin found at http://gabrito.com/post/ruby-on-rails-dreamhost-plugin, but I was unable to get that to work. Good luck. On Nov 29, 5:43 pm, Sam Kong <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Frederick Cheung wrote: > > On 29 Nov 2007, at 21:35, Sam Kong wrote: > > >>>> I am the only one who accesses the site. > >> new > >> one (PID''s are different). > > > Well if for whatever reason you end up getting a request server by a > > new dispatch.fcgi that will slow things down, since booting the rails > > environment takes some time, and obviously none of your code is > > cached. This is probably a magic fast-cgi problem. I''ve moved away > > from using that a long time ago, so no clue on why this is happening. > > > Fred > > Thank you for the explanation. > Do you know if there''s an alternative to fast-cgi on Dreamhost? > > Sam > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sam Kong
2007-Nov-30 23:09 UTC
Re: Page loads very slowly on Dreamhost after some idle time
Hi, HiddenBek wrote:> The only alternative that I''m aware of is regular cgi, which is even > slower. Dreamhost greatly oversells their capacity and must kill off > processes constantly to keep resource usage down. The best solution > is to switch to a decent host, but running a cron job that hits your > site every 5 minutes should keep a dispatch.fcgi ready to go most of > the time. > > Heavy page caching will make a big difference of course. Cached pages > are served entirely by apache, so Rails environment startup time isn''t > a factor. This is a tricky subject though, and probably isn''t worth > bothering with just to save a few bucks a month on web hosting. > > Dreamhost will happily kill dispatch.fcgi in the middle of a request, > leading to intermittent 500 errors. I wrote a plugin in to correct > this. Install it with: > > script/plugin install > http://hg.rubyinspace.com/public/plugins/file/tip/impolite_host/ > > Be sure to look at the README. This plugin interferes with webrick or > mongrel, so it''s disabled by default. A small change to dispatch.fcgi > is required to turn it on. This plugin is similar to the dreamhost > plugin found at http://gabrito.com/post/ruby-on-rails-dreamhost-plugin, > but I was unable to get that to work. > > Good luck.I tried the plugin found at http://gabrito.com/post/ruby-on-rails-dreamhost-plugin and I also failed to get that to work. Now I''m testing your plugin and so far so good (for 4 hours now). With your plugin, have you fixed the problem for sure? Thanks. Sam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
HiddenBek
2007-Dec-01 00:11 UTC
Re: Page loads very slowly on Dreamhost after some idle time
I''ve been running with the plugin for a few weeks now and my cron script, which hits my site every 5 minutes, 24/7, has only returned an error twice. I believe both were network issues. Dreamhost has a bunch of servers however, and I don''t think they''re all configured the same way, so your mileage may vary. This won''t do anything about processes killed during idle times, so you''ll still hit occasional slowdowns while rails initializes. If a dispatch.fcgi is killed in the middle of a request though, it will wait until the request is served to terminate. It''s a very simple change and should be pretty much foolproof, but feel free to email me if you run into trouble. On Nov 30, 7:09 pm, Sam Kong <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > > > HiddenBek wrote: > > The only alternative that I''m aware of is regular cgi, which is even > > slower. Dreamhost greatly oversells their capacity and must kill off > > processes constantly to keep resource usage down. The best solution > > is to switch to a decent host, but running a cron job that hits your > > site every 5 minutes should keep a dispatch.fcgi ready to go most of > > the time. > > > Heavy page caching will make a big difference of course. Cached pages > > are served entirely by apache, so Rails environment startup time isn''t > > a factor. This is a tricky subject though, and probably isn''t worth > > bothering with just to save a few bucks a month on web hosting. > > > Dreamhost will happily kill dispatch.fcgi in the middle of a request, > > leading to intermittent 500 errors. I wrote a plugin in to correct > > this. Install it with: > > > script/plugin install > >http://hg.rubyinspace.com/public/plugins/file/tip/impolite_host/ > > > Be sure to look at the README. This plugin interferes with webrick or > > mongrel, so it''s disabled by default. A small change to dispatch.fcgi > > is required to turn it on. This plugin is similar to the dreamhost > > plugin found athttp://gabrito.com/post/ruby-on-rails-dreamhost-plugin, > > but I was unable to get that to work. > > > Good luck. > > I tried the plugin found athttp://gabrito.com/post/ruby-on-rails-dreamhost-pluginand I also failed > to get that to work. > > Now I''m testing your plugin and so far so good (for 4 hours now). > > With your plugin, have you fixed the problem for sure? > > Thanks. > > Sam > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sam Kong
2007-Dec-01 00:32 UTC
Re: Page loads very slowly on Dreamhost after some idle time
HiddenBek wrote:> I''ve been running with the plugin for a few weeks now and my cron > script, which hits my site every 5 minutes, 24/7, has only returned an > error twice. I believe both were network issues. Dreamhost has a > bunch of servers however, and I don''t think they''re all configured the > same way, so your mileage may vary.That''s a very good news and I''m relieved.:-)> > This won''t do anything about processes killed during idle times, so > you''ll still hit occasional slowdowns while rails initializes. If a > dispatch.fcgi is killed in the middle of a request though, it will > wait until the request is served to terminate. It''s a very simple > change and should be pretty much foolproof, but feel free to email me > if you run into trouble.It''s so kind of you. Thank you. Sam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sam Kong
2007-Dec-04 02:09 UTC
Re: Page loads very slowly on Dreamhost after some idle time
Hi HiddenBek, HiddenBek wrote:> I''ve been running with the plugin for a few weeks now and my cron > script, which hits my site every 5 minutes, 24/7, has only returned an > error twice. I believe both were network issues. Dreamhost has a > bunch of servers however, and I don''t think they''re all configured the > same way, so your mileage may vary. > > This won''t do anything about processes killed during idle times, so > you''ll still hit occasional slowdowns while rails initializes. If a > dispatch.fcgi is killed in the middle of a request though, it will > wait until the request is served to terminate. It''s a very simple > change and should be pretty much foolproof, but feel free to email me > if you run into trouble.I find my site sometimes responds very slowly after hours of inactivity. However, the frequency of the occurrence is very low with your plugin.:-) Your cron job hits your site every 5 minutes. Do you think the cron job keeps the site active all the time and prevents the slow load? If that''s the case, the solution would be simple or it might not even be a problem if visitors kept my site busy. Any idea? Unfortunately, I''m not an expert on Linux and Apache. Thanks. Sam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Donald
2007-Dec-04 21:03 UTC
Re: Page loads very slowly on Dreamhost after some idle time
On Dec 3, 2007 8:09 PM, Sam Kong <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I find my site sometimes responds very slowly after hours of inactivity.Have you tried forcing more frequent garbage collection? I use this on one site I run: RailsFCGIHandler.process! nil, 50 -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sam Kong
2007-Dec-04 21:15 UTC
Re: Page loads very slowly on Dreamhost after some idle time
Greg Donald wrote:> On Dec 3, 2007 8:09 PM, Sam Kong <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> I find my site sometimes responds very slowly after hours of inactivity. > > Have you tried forcing more frequent garbage collection? I use this > on one site I run: > > RailsFCGIHandler.process! nil, 50 > > > -- > Greg Donald > http://destiney.com/I just changed it. I''ll let you know. Thanks. Sam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---