With the release of our filmfury.com project, I''ve been trying to
rise to the stature of a true system administrator in the last couple
of days (haha). I''m trying to understand how all of the pieces to
this apache/fastcgi deployment fit together.
Here''s what I''ve learned so far:
* You need a separate FastCGI server for each Rails application on
your box. An Apache Server "has_many" FastCGI servers and a FastCGI
server "has_many" FastCGI processes. A FastCGI server controls and
monitors its processes, and a "FastCGI Process" is simply a ready-and-
waiting dispatch.fcgi ruby script running in memory.
- On FreeBSD/unix-based systems you can use the following command
to find and display the PIDs of all running FastCGI processes:
$ ps auxw | grep fcgi
www 34358 0.0 1.1 24692 23708 ?? I 10:30AM 0:12.40
/usr/local/bin/ruby /home/users/filmfury/public_html/dispatch.fcgi
- To find the controlling FastCGI server process itself, grep your
apache error log file for the fastcgi process id, right after
starting the Apache server. Then use ''ps'' again to find the
process
running:
$ tail -n 100 | grep -i "fastcgi" /var/log/httpd-errors.log
[Thu Jun 30 10:29:59 2005] [notice] FastCGI: process
manager initialized (pid 34084)
$ ps auxw | grep 34084
www 34084 0.0 1.0 37084 21764 ?? S 10:29AM 0:00.45
/usr/local/sbin/httpd -DSSL
Note that the FastCGI server process is actually registered as
an httpd process under ''ps''.
* There are two ways to configure a FastCGI server: statically or
dynamically. Statically means a certain number of FastCGI processes
will stay running all of the time (does anyone know if this is true
even if they crash?). Dynamically means the FastCGI server (the
monitoring/controlling process) will create and destroy FastCGI
processes on an as-needed basis.
- An example static configuration (from Norman Timmler and David
Hansson):
<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc
FastCgiServer /app/public/dispatch.fcgi \
-initial-env RAILS_ENV=production \
-processes 15 -idle-timeout 60
</IfModule>
(Note that the backslashes in the above FastCgiServer line
should be removed--those three lines are really one line.)
- An example dynamic configuration:
<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
FastCgiConfig -restart -minProcesses 5 -maxProcesses 50 \
-initial-env RAILS_ENV=production -idle-timeout 360 \
-pass-header HTTP_AUTHORIZATION
</IfModule>
As of this writing, I have been unable to get the dynamic processes
to stay running (they die mysteriously and do not get restarted even
though the -restart directive is included in the FastCgiConfig
setting). I''m going to switch to David and Norman''s
recommended
static configuration.
Duane Johnson
(canadaduane)
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
Hey Duane, cool site! I noticed that any question regarding legality of distributing the movies is conspicuously absent from your FAQ. Are you basically running a movie owning club, where members have collective ownership of all the movies in the collection? On 6/30/05, Duane Johnson <duane.johnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > With the release of our filmfury.com <http://filmfury.com> project,_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Jun 30, 2005, at 12:38 PM, Carl Youngblood wrote:> Hey Duane, cool site! I noticed that any question regarding > legality of distributing the movies is conspicuously absent from > your FAQ. Are you basically running a movie owning club, where > members have collective ownership of all the movies in the collection?Thanks Carl. I''ll pass the question on to the site owner. I''m sure he''ll appreciate knowing about this oversight. Duane Johnson (canadaduane)
Duane Johnson wrote:> On Jun 30, 2005, at 12:38 PM, Carl Youngblood wrote: > >> Hey Duane, cool site! I noticed that any question regarding >> legality of distributing the movies is conspicuously absent from >> your FAQ. Are you basically running a movie owning club, where >> members have collective ownership of all the movies in the collection? > > > Thanks Carl. I''ll pass the question on to the site owner. I''m sure > he''ll appreciate knowing about this oversight. > > Duane Johnson > (canadaduane) > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/railsAs the other developer on the project, I''ll answer the other question :-) He''s actually getting old movies and TV shows where he can actually acquire the copyright for free (or very cheap). You''ll notice that none of those movies are new. I don''t think there are any movies in there that are younger than I am, and I was born in 1982. Still there are a few that are in color, and I believe his plan is that as the business picks up, he''ll start to have money to spend on newer movies. Anyway, hopefully there''s something in there that interests you and we can work out our deployment issues :) Ben -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.8.7/34 - Release Date: 6/29/2005
Duane Johnson wrote:> With the release of our filmfury.com project, I''ve been trying to rise > to the stature of a true system administrator in the last couple of days > (haha). I''m trying to understand how all of the pieces to this > apache/fastcgi deployment fit together. > > Here''s what I''ve learned so far: > > * You need a separate FastCGI server for each Rails application on your > box. An Apache Server "has_many" FastCGI servers and a FastCGI server > "has_many" FastCGI processes. A FastCGI server controls and monitors > its processes, and a "FastCGI Process" is simply a ready-and-waiting > dispatch.fcgi ruby script running in memory. > - On FreeBSD/unix-based systems you can use the following command to > find and display the PIDs of all running FastCGI processes: > $ ps auxw | grep fcgi > www 34358 0.0 1.1 24692 23708 ?? I 10:30AM 0:12.40 > /usr/local/bin/ruby /home/users/filmfury/public_html/dispatch.fcgi > - To find the controlling FastCGI server process itself, grep your > apache error log file for the fastcgi process id, right after starting > the Apache server. Then use ''ps'' again to find the process running: > $ tail -n 100 | grep -i "fastcgi" /var/log/httpd-errors.log > [Thu Jun 30 10:29:59 2005] [notice] FastCGI: process > manager initialized (pid 34084) > > $ ps auxw | grep 34084 > www 34084 0.0 1.0 37084 21764 ?? S 10:29AM 0:00.45 > /usr/local/sbin/httpd -DSSL > > Note that the FastCGI server process is actually registered as an > httpd process under ''ps''. > > * There are two ways to configure a FastCGI server: statically or > dynamically. Statically means a certain number of FastCGI processes > will stay running all of the time (does anyone know if this is true even > if they crash?). Dynamically means the FastCGI server (the > monitoring/controlling process) will create and destroy FastCGI > processes on an as-needed basis. > - An example static configuration (from Norman Timmler and David Hansson): > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc > FastCgiServer /app/public/dispatch.fcgi \ > -initial-env RAILS_ENV=production \ > -processes 15 -idle-timeout 60 > </IfModule> > (Note that the backslashes in the above FastCgiServer line should be > removed--those three lines are really one line.) > > - An example dynamic configuration: > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > > AddHandler fastcgi-script .fcgi > FastCgiConfig -restart -minProcesses 5 -maxProcesses 50 \ > -initial-env RAILS_ENV=production -idle-timeout 360 \ > -pass-header HTTP_AUTHORIZATION > </IfModule> > > As of this writing, I have been unable to get the dynamic processes to > stay running (they die mysteriously and do not get restarted even though > the -restart directive is included in the FastCgiConfig setting). I''m > going to switch to David and Norman''s recommended static configuration. > > Duane Johnson > (canadaduane) > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails