Tom M. wrote:
[…]
So application performance can’t be ignored, and more specifically,
solving the puzzle of Rails configuration for high performance is not
trivial.
What’s non-trivial?
It’s as easy, and thanks to lighhtpd (no, not part of Rails, but I
thank Rails for introducing me to it!) easier than mod_perl, and the
same as anything else running FCGI…
This is a serious question. Supposing that lighttpd is not suitable to
your application, or you can’t use it for some reason [*], then you can
use Apache 1.3 or 2, as I have been trying to do.
Setting up fastcgi using “external”, I find there are many times when
Rails does not give an error message with any information, just a 500 or
a blank response. If dispatch.fcgi dies when started as an external
server, it dies w/o error. There is little documentation on how to do
this. So, it was a struggle for me.
Eventually, I did get it working [**] thanks to the people on this list,
but there are still serious issues.
This is not to put any blame on the Rails team. It is just a newish
system. The fcgi documentation is sparse as well, and error reporting
there is not great. So, non-trivial, overall.
Regards,
Jim
http://article.gmane.org/gmane.comp.web.lighttpd/3287
**
INITIAL RUBY ON RAILS BENCHTEST
This is on a laptop running linux 2.6, 512MB RAM, 1.7 GHz pentium M.
These figures are for relative comparison only, and do not reflect how
these systems would run on a well-tuned server. The person who set
these up has several years using the Apache httpd on a professional,
high volume web site, and has no experience (<1 month) with lighttpd.
STATIC PAGE FOR COMPARISON:
$ ab -c10 -n1000 -k http://ruby.local:8000/index.html
Apache/2.0.53, fcgi: 564.99 [#/sec] (mean)
Apache/1.3.34, fcgi: 1236.24 [#/sec] (mean)
lighttpd 1.4.9, fcgi: 3270.16 [#/sec] (mean)
DUMMY RAILS CONTROLLER:
$ script/generate controller foo hello
$ ab -c10 -n1000 -k http://ruby.local:8000/foo/hello
Apache/2.0.53, fcgi: 9.65 [#/sec] (mean) <---- using “dynamic” fcgi
method
10.13 [#/sec] (mean) <---- using “static” with
-processes 2
9.98 [#/sec] (mean) <---- using “static” with
-processes 4
136.24 [#/sec] (mean) <---- using “external”
with tcp sock **
Apache/1.3.34, fcgi: *
Apache/2.0.53, cgi: 0.79 [#/sec] (mean)
lighttpd 1.4.9, fcgi: 195.70 [#/sec] (mean) <---- using “external” with
tcp sock ***
$ ab -c100 -n10000 -k http://ruby.local:8000/foo/hello
Apache/2.0.53, fcgi: 109.79 [#/sec] <---- using “external” with
tcp sock **
NOTES
- Can’t get it working. Fails w/ only a “500” from server, no further
error msg.
** This method seems to support only one external fcgi server under
Apache, essentially giving you a single-threaded server.
spin script:
#!/bin/sh
/home/jim/rubystuff/testapp/script/process/spinner
-c '/home/jim/rubystuff/testapp/script/process/spawner -p 19999 -i 1
’
-d
*** hint: delete the /tmp/ruby-sess* files owned by root