hi! im curious what''s your experience with the performance of rails. i''m having a server here which is a: model name : Intel(R) Pentium(R) 4 CPU 2.40GHz with 1 gb of ram what confuses me a bit is that even for simple requests which basically just do one sql query for one model class and display those items (about 10) in a very simple template, webrick can''t serve more than 4 or 5 requests per second. i''m using the latest version rails and using the production environment. i know that apache is a better idea, i just didnt get around yet to install it. but i''m still suprised by the current performance. what could i be doing wrong? thanks! ciao! florian
Florian Weber wrote:> im curious what''s your experience with the performance of rails. i''m > having a server here which is a: > > model name : Intel(R) Pentium(R) 4 CPU 2.40GHz > > with 1 gb of ram > > what confuses me a bit is that even for simple requests which basically > just do one sql query for one model class and display those items (about > 10) in a very simple template, webrick can''t serve more than 4 or 5 > requests > per second.This is quite normal; the Webrick dispatcher is slow. You can expect about 10 times more speed with fastcgi.
Rails performance in fastcgi is generally similar to php performance. What eats up your performance is all the extra lifting webrick does in the development environment. If you switch to production mode you will see better results and better ones yet once you migrate to fastcgi. On Sun, 26 Dec 2004 15:33:43 +0100, Andreas Schwarz <usenet-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Florian Weber wrote: > > im curious what''s your experience with the performance of rails. i''m > > having a server here which is a: > > > > model name : Intel(R) Pentium(R) 4 CPU 2.40GHz > > > > with 1 gb of ram > > > > what confuses me a bit is that even for simple requests which basically > > just do one sql query for one model class and display those items (about > > 10) in a very simple template, webrick can''t serve more than 4 or 5 > > requests > > per second. > > This is quite normal; the Webrick dispatcher is slow. You can expect > about 10 times more speed with fastcgi. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://blog.leetsoft.com
On Dec 26, 2004, at 15:33 Uhr, Andreas Schwarz wrote:> Florian Weber wrote: >> im curious what''s your experience with the performance of rails. i''m >> having a server here which is a: >> model name : Intel(R) Pentium(R) 4 CPU 2.40GHz >> with 1 gb of ram >> what confuses me a bit is that even for simple requests which >> basically >> just do one sql query for one model class and display those items >> (about >> 10) in a very simple template, webrick can''t serve more than 4 or 5 >> requests >> per second. > > This is quite normal; the Webrick dispatcher is slow. You can expect > about 10 times more speed with fastcgi.i just gave it a try with apache2 (i know there are issues with it and fastcgi).. but now i get this: Requests per second: 0.96 [#/sec] (mean) while the production.log tells me: Completed in 0.025388 (39 reqs/sec) | Rendering: 0.014524 (57%) | DB: 0.000957 (3%)
this is most likely cgi mode. http://www.rubyonrails.org/show/ProductionEnvironments On Sun, 26 Dec 2004 15:47:59 +0100, Florian Weber <csshsh-WuBoz9ku3QfAi70hqydFXw@public.gmane.org> wrote:> > On Dec 26, 2004, at 15:33 Uhr, Andreas Schwarz wrote: > > > Florian Weber wrote: > >> im curious what''s your experience with the performance of rails. i''m > >> having a server here which is a: > >> model name : Intel(R) Pentium(R) 4 CPU 2.40GHz > >> with 1 gb of ram > >> what confuses me a bit is that even for simple requests which > >> basically > >> just do one sql query for one model class and display those items > >> (about > >> 10) in a very simple template, webrick can''t serve more than 4 or 5 > >> requests > >> per second. > > > > This is quite normal; the Webrick dispatcher is slow. You can expect > > about 10 times more speed with fastcgi. > > i just gave it a try with apache2 (i know there are issues with it and > fastcgi).. > > but now i get this: > > Requests per second: 0.96 [#/sec] (mean) > > while the production.log tells me: > > Completed in 0.025388 (39 reqs/sec) | Rendering: 0.014524 (57%) | DB: > 0.000957 (3%) > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://blog.leetsoft.com
On Dec 26, 2004, at 15:57 Uhr, Tobias Luetke wrote:> this is most likely cgi mode. > http://www.rubyonrails.org/show/ProductionEnvironmentsarg! true! i could have sworn that i set the .htaccess file to use fastcgi by default.. looks better now: Requests per second: 18.25 [#/sec] (mean) thanks!
I just updated http://www.rubyonrails.org/show/FastCGI to show how to switch to production environment when using fastcgi. On Sun, 26 Dec 2004 16:18:31 +0100, Florian Weber <florian-IkFsbiHgq2wGt2XWv0ZhvtBPR1lH4CV8@public.gmane.org> wrote:> > On Dec 26, 2004, at 15:57 Uhr, Tobias Luetke wrote: > > > this is most likely cgi mode. > > http://www.rubyonrails.org/show/ProductionEnvironments > > arg! true! i could have sworn that i set the .htaccess file to use > fastcgi by default.. > > looks better now: > > Requests per second: 18.25 [#/sec] (mean) > > thanks! > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://blog.leetsoft.com
That''s more like it, I am getting: Requests per second: 35.11 [#/sec] (mean) Apache2/FastCGI in production env on a Dual Xeon 1.7GHz-1GB RAM IDE disks, RHEL + PGSQL. On Sun, 26 Dec 2004 16:18:31 +0100, Florian Weber <florian-IkFsbiHgq2wGt2XWv0ZhvtBPR1lH4CV8@public.gmane.org> wrote:> looks better now: > > Requests per second: 18.25 [#/sec] (mean) >-- Bruno Mattarollo <bruno.mattarollo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>