Duane Johnson
2005-Jun-24 16:52 UTC
Where should I start looking to reduce gross slowdown from apache/fcgi?
Thanks to all who recently gave me some great starting points on benchmarking and stress testing. As it turns out, our apache/fcgi configuration is severely underperforming--something I already knew-- so I need to ask another question. Our application is quite responsive when run in WEBrick; however, apache and fcgi are not giving us the expected boost in performance. We''re running in production mode using edge rails (hoping to get some performance boosts), but getting 1/3 to 1/4 requests per second. The time to load is consistent across all pages in the application (including very simple uncached pages), so I''m guessing that either something is requiring a new process to load with every request, or else my configuration is way off. Looking at the production log, I''m seeing ''SHOW FIELDS'' on each request, which makes me suspect the former. Cached pages load instantaneously. This is what my fastcgi configuration looks like: <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc/ AddHandler fastcgi-script .fcgi FastCgiConfig -restart -initial-env RAILS_ENV=production - killInterval 300 \ -autoUpdate -idle -timeout 360 -pass-header HTTP_AUTHORIZATION </IfModule> What kinds of factors should I be looking into here? Using ''top'' doesn''t show any terrible process hogs. Any hints from the experienced fcgi / freebsd admins? Thank-you, Duane Johnson (canadaduane) _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Tobias Luetke
2005-Jun-24 19:33 UTC
Re: Where should I start looking to reduce gross slowdown from apache/fcgi?
I''m pretty sure you are running in CGI mode. Hit your public/.htaccess file and replace dispatch.cgi with dispatch.fcgi also remove -killInterval 300 -autoUpdate and -idle from your config. You also probably want to fix it to a certain amount of processes thats what almost all rails production sites do. 5 handlers is great for most cases. On 6/24/05, Duane Johnson <duane.johnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks to all who recently gave me some great starting points on > benchmarking and stress testing. As it turns out, our apache/fcgi > configuration is severely underperforming--something I already knew--so I > need to ask another question. > > Our application is quite responsive when run in WEBrick; however, apache and > fcgi are not giving us the expected boost in performance. We''re running in > production mode using edge rails (hoping to get some performance boosts), > but getting 1/3 to 1/4 requests per second. The time to load is consistent > across all pages in the application (including very simple uncached pages), > so I''m guessing that either something is requiring a new process to load > with every request, or else my configuration is way off. Looking at the > production log, I''m seeing ''SHOW FIELDS'' on each request, which makes me > suspect the former. Cached pages load instantaneously. > > This is what my fastcgi configuration looks like: > > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > AddHandler fastcgi-script .fcgi > FastCgiConfig -restart -initial-env RAILS_ENV=production -killInterval > 300 \ > -autoUpdate -idle -timeout 360 -pass-header HTTP_AUTHORIZATION > </IfModule> > > What kinds of factors should I be looking into here? Using ''top'' doesn''t > show any terrible process hogs. Any hints from the experienced fcgi / > freebsd admins? > > Thank-you, > > Duane Johnson > (canadaduane) > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Tobi http://www.snowdevil.ca - Snowboards that don''t suck http://typo.leetsoft.com - Open source weblog engine http://blog.leetsoft.com - Technical weblog
Duane Johnson
2005-Jun-24 21:10 UTC
Re: Where should I start looking to reduce gross slowdown from apache/fcgi?
I could kiss you. But I won''t. Thanks Tobias. On Jun 24, 2005, at 1:33 PM, Tobias Luetke wrote:> I''m pretty sure you are running in CGI mode. Hit your public/.htaccess > file and replace dispatch.cgi with dispatch.fcgi also remove > -killInterval 300 -autoUpdate and -idle from your config. You also > probably want to fix it to a certain amount of processes thats what > almost all rails production sites do. 5 handlers is great for most > cases. > > > On 6/24/05, Duane Johnson <duane.johnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Thanks to all who recently gave me some great starting points on >> benchmarking and stress testing. As it turns out, our apache/fcgi >> configuration is severely underperforming--something I already >> knew--so I >> need to ask another question. >> >> Our application is quite responsive when run in WEBrick; however, >> apache and >> fcgi are not giving us the expected boost in performance. We''re >> running in >> production mode using edge rails (hoping to get some performance >> boosts), >> but getting 1/3 to 1/4 requests per second. The time to load is >> consistent >> across all pages in the application (including very simple >> uncached pages), >> so I''m guessing that either something is requiring a new process >> to load >> with every request, or else my configuration is way off. Looking >> at the >> production log, I''m seeing ''SHOW FIELDS'' on each request, which >> makes me >> suspect the former. Cached pages load instantaneously. >> >> This is what my fastcgi configuration looks like: >> >> <IfModule mod_fastcgi.c> >> FastCgiIpcDir /tmp/fcgi_ipc/ >> AddHandler fastcgi-script .fcgi >> FastCgiConfig -restart -initial-env RAILS_ENV=production - >> killInterval >> 300 \ >> -autoUpdate -idle -timeout 360 -pass-header HTTP_AUTHORIZATION >> </IfModule> >> >> What kinds of factors should I be looking into here? Using ''top'' >> doesn''t >> show any terrible process hogs. Any hints from the experienced >> fcgi / >> freebsd admins? >> >> Thank-you, >> >> Duane Johnson >> (canadaduane) >> >> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >> > > > -- > Tobi > http://www.snowdevil.ca - Snowboards that don''t suck > http://typo.leetsoft.com - Open source weblog engine > http://blog.leetsoft.com - Technical weblog > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Duane Johnson (canadaduane)