FastCGI performance question


#1

Hello,

I’m coming from a PHP, ASP and JSP environment and learning Rails.
I just purchased the “Agile Web D. with Rails” and find it
excellent.

Here’s my question:
I always thought that CGI apps were slow and memory hogs as compared to
servlets that have one copy in memory.

Is this true when hosting rails apps on Windows?
I hope not as I am really impressed with Rails web development.

Thanks

Frank


#2

On 5/12/2005, at 7:40 AM, Frank R. wrote:

Here’s my question:
I always thought that CGI apps were slow and memory hogs as
compared to servlets that have one copy in memory.

Is this true when hosting rails apps on Windows?

Rails uses FastCGI which behaves similar to a servlet - it loads one
copy and keeps it loaded, and therefore is quite fast.


Phillip H.
removed_email_address@domain.invalid


#3

Hi, Frank,

coming from java-webapp-development myself I’m petty impressed until
now, what rails has achieved performance wise. Here is a pointer to some
research done by Justin Gehtland:
http://weblog.rubyonrails.com/articles/2005/04/04/justin-160-gehtland-is-back-with-numbers-to-back-it-up
. You might also be interested in switchtower:
http://manuals.rubyonrails.com/read/book/17 which you’ll want to use if
scaling is an issue.

Regards
Jan Pril.


#4

On Sun, 4 Dec 2005, Frank R. wrote:

Hello,

I’m coming from a PHP, ASP and JSP environment and learning Rails. I just
purchased the “Agile Web D. with Rails” and find it excellent.

Here’s my question: I always thought that CGI apps were slow and memory hogs
as compared to servlets that have one copy in memory.

a fastcgi process is a servlet. rails runs in two modes cgi and
fastcgi. cgi is slow and for development only, fastcgi is a servlet
type
model which is several orders of magnitude faster that plain cgi.

google fastcgi.

cheers.

-a


#5

Thanks for the links.
I appreciate everybody’s help.

Frank
----- Original Message -----
From: “Jan P.” removed_email_address@domain.invalid
To: removed_email_address@domain.invalid
Sent: Sunday, December 04, 2005 1:55 PM
Subject: Re: [Rails] FastCGI performance question


#6

Thanks you, I did not realize that.

Frank

----- Original Message -----
From: removed_email_address@domain.invalid
To: removed_email_address@domain.invalid
Sent: Sunday, December 04, 2005 2:02 PM
Subject: Re: [Rails] FastCGI performance question

as compared to servlets that have one copy in memory.

===============================================================================
| ara [dot] t [dot] howard [at] noaa [dot] gov
| all happiness comes from the desire for others to be happy. all misery
| comes from the desire for oneself to be happy.
| – bodhicaryavatara
===============================================================================



Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



#7

removed_email_address@domain.invalid wrote:

as compared to servlets that have one copy in memory.

a fastcgi process is a servlet. rails runs in two modes cgi and
fastcgi. cgi is slow and for development only, fastcgi is a servlet type
model which is several orders of magnitude faster that plain cgi.

I strongly suggest not to use CGI at all, not even for development
mode. For several reasons:

  1. The execution model of CGI is very different from FCGI.
  2. Developing in an environment that doesn’t resemble your production
    environment as closely as possible is bound to hide potential production
    environment problems.
  3. It will slow down your development process considerably.

– stefan

http://railsexpress.de/blog


#8

I’m curious about this…does lighttpd running through script/server use
FCGI or not?

skaes wrote:

I strongly suggest not to use CGI at all, not even for development
mode. For several reasons:

  1. The execution model of CGI is very different from FCGI.
  2. Developing in an environment that doesn’t resemble your production
    environment as closely as possible is bound to hide potential production
    environment problems.
  3. It will slow down your development process considerably.

– stefan

http://railsexpress.de/blog


#9

lighttpd does use fcgi, but as it was stated earlier, it runs
completly differently then regular cgi. Webrick uses its very own
method I’m assuming, becuse its all in rails.