I know this is kind of a generic question. But, when hitting my lighttpd/rails site on some of the first hits, the site hangs. I think it has something with the lighttpd configuration, possibly something I am missing with rails or ruby? Any ideas or how to track this down. fastcgi.server = ( ".fcgi" => ( "0.0.0.0" => ( "socket" => "/home/bbrown/light/lighttpd/log/fast.socket", "min-procs" => 2, "max-procs" => 12, "idle-timeout" => 30, "bin-path" => "/home/bbrown/light/BotVerse/web/botverse/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "development" ), ) ) ) ruby 1.8.3 (2005-06-23) [i486-linux] Rails 1.0.0
The answer is no. You will most likely never need 12 dispatchers, especially when your RAILS_ENV is development. Each dispatcher is attempting to get its share of memory, so that could be the reason for your site to hang. On 3/25/06, Berlin Brown <berlin.brown@gmail.com> wrote:> > I know this is kind of a generic question. But, when hitting my > lighttpd/rails site on some of the first hits, the site hangs. I > think it has something with the lighttpd configuration, possibly > something I am missing with rails or ruby? Any ideas or how to track > this down. > > fastcgi.server = ( > ".fcgi" => ( > "0.0.0.0" => ( > "socket" => "/home/bbrown/light/lighttpd/log/fast.socket", > "min-procs" => 2, > "max-procs" => 12, > "idle-timeout" => 30, > "bin-path" => > "/home/bbrown/light/BotVerse/web/botverse/public/dispatch.fcgi", > "bin-environment" => ( "RAILS_ENV" => "development" ), > ) > ) > ) > > ruby 1.8.3 (2005-06-23) [i486-linux] > > Rails 1.0.0 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060325/9f8b5d01/attachment.html
Berlin- The hand you are seeing is because you are using 12 dispatchers. Those twelve dispatcher processes each take up anywhere from 20Mb to 90MB *each* so when your site is not getting hit for a while, those dispatchers get swapped out of memory to disk and that could mean paging back in 12*(20Mb-90Mb). So when you come back and hit the site, all twelve dispatchers need to get paged back into memory and this can take a while especially with 12 processes. The min-procs does not do anything in lighttpd currently, its deprecated for now. So whatever you set your max-procs to is what will get started up when you start lighty. You probably only need one or two dispatcher until your site is geting major traffic. For dev just use one fcgi unless you need two for upload_progress or something else that requires two dispatchers at once. Now one way to keep the hang from happening when there is inactiv is to use wget or curl with a cron job to grab a dynamic page from your site and send the output to /dev/null. This ''exercises'' your fcgi''s so they don''t get swapped out of main memory. Cheers- -Ezra _____ From: Bogdan Ionescu [mailto:bogdan.ionescu@gmail.com] To: rails@lists.rubyonrails.org Sent: Sat, 25 Mar 2006 02:4505 -0800 Subject: Re: [Rails] Rails and Lighttpd, hangs? The answer is no. You will most likely never need 12 dispatchers, especially when your RAILS_ENV is development. Each dispatcher is attempting to get its share of memory, so that could be the reason for your site to hang. On 3/25/06, Berlin Brown <berlin.brown@gmail.com> wrote: I know this is kind of a generic question. But, when hitting my lighttpd/rails site on some of the first hits, the site hangs. I think it has something with the lighttpd configuration, possibly something I am missing with rails or ruby? Any ideas or how to track this down. fastcgi.server = ( ".fcgi" => ( "0.0.0.0" => ( "socket" => "/home/bbrown/light/lighttpd/log/fast.socket", "min-procs" => 2, "max-procs" => 12, "idle-timeout" => 30, "bin-path" => "/home/bbrown/light/BotVerse/web/botverse/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "development" ), ) ) ) ruby 1.8.3 (2005-06-23) [i486-linux] Rails 1.0.0 _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060325/b0d5bf5f/attachment.html
Ezra Zymuntowicz wrote:> Berlin- > > The hand you are seeing is because you are using 12 dispatchers. Those > twelve dispatcher processes each take up anywhere from 20Mb to 90MB > *each* so when your site is not getting hit for a while, those > dispatchers get swapped out of memory to disk and that could mean > paging back in 12*(20Mb-90Mb). So when you come back and hit the site, > all twelve dispatchers need to get paged back into memory and this can > take a while especially with 12 processes. > > The min-procs does not do anything in lighttpd currently, its > deprecated for now. So whatever you set your max-procs to is what will > get started up when you start lighty. You probably only need one or > two dispatcher until your site is geting major traffic. For dev just > use one fcgi unless you need two for upload_progress or something else > that requires two dispatchers at once. > > Now one way to keep the hang from happening when there is inactiv > is to use wget or curl with a cron job to grab a dynamic page from > your site and send the output to /dev/null. This ''exercises'' your > fcgi''s so they don''t get swapped out of main memory. > > Cheers- > > -Ezra > > > > > > > > > ------------------------------------------------------------------------ > *From:* Bogdan Ionescu [mailto:bogdan.ionescu@gmail.com] > *To:* rails@lists.rubyonrails.org > *Sent:* Sat, 25 Mar 2006 02:4505 -0800 > *Subject:* Re: [Rails] Rails and Lighttpd, hangs? > > The answer is no. > You will most likely never need 12 dispatchers, especially when > your RAILS_ENV is development. > Each dispatcher is attempting to get its share of memory, so that > could be the reason for your site to hang. > > > On 3/25/06, *Berlin Brown* <berlin.brown@gmail.com > <mailto:berlin.brown@gmail.com>> wrote: > > I know this is kind of a generic question. But, when hitting my > lighttpd/rails site on some of the first hits, the site hangs. I > think it has something with the lighttpd configuration, possibly > something I am missing with rails or ruby? Any ideas or how > to track > this down. > > fastcgi.server = ( > ".fcgi" => ( > "0.0.0.0 <http://0.0.0.0/>" => ( > "socket" => > "/home/bbrown/light/lighttpd/log/fast.socket", > "min-procs" => 2, > "max-procs" => 12, > "idle-timeout" => 30, > "bin-path" => > "/home/bbrown/light/BotVerse/web/botverse/public/dispatch.fcgi", > "bin-environment" => ( "RAILS_ENV" => "development" ), > ) > ) > ) > > ruby 1.8.3 (2005-06-23) [i486-linux] > > Rails 1.0.0 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >I added the 12 procs as a test. I had the issue when I had 1 and 1 max procs. -- Berlin Brown (ramaza3 on freenode) http://www.newspiritcompany.com also checkout alpha version of botverse: http://www.newspiritcompany.com:8086/universe_home