views:

191

answers:

1

I am new to FastCGI and looking to use this platform to speed up my existing vanilla CGI (perl) programs.

However in reading the FastCGI/Apache FAQ, it appears I can setup my scripts (once converted to use separate initialization/request sections) in the Apache config as one of the following:

1) dynamic

2) static "inside the scope of the SetHandler"

3) static "inside the scope of the AddHandler"

4) static "outside the scope of the Set/AddHandler" (or, I think, this can be called 'external')

I am confused about those 4 options, and am assuming the default of 'dynamic' is what I should go with, but could someone explain the pros/cons of these?

+2  A: 

There isn't much to worry about Add/SetHandlers. They are just a way of defining which extensions are to be recognized as fcgi scripts.

What you might want to consider is dynamic, static or external.

  1. Static is started as apache starts (possible this is the most common setup)
  2. Dynamic is started whenever the first request is made (This is the default)
  3. External requires the fcgi server to run separately from apache. (This is the most advanced configration)

I suggest you refer to the module documentation for more information (at least the summary):

FastCGI applications under mod_fastcgi are defined as one of three types: static, dynamic, or external. They're configured using the FastCgiServer, FastCgiConfig, and FastCgiExternalServer directives respectively. Any URI that Apache identifies as a FastCGI application and which hasn't been explicitly configured using a FastCgiServer or FastCgiExternalServer directive is handled as a dynamic application (see the FastCgiConfig directive for more information).

FastCGI static and dynamic applications are spawned and managed by the FastCGI Process Manager, fcgi-pm. The process manager is spawned by Apache at server initialization. External applications are presumed to be started and managed independently.

Of course if you are using Perl you can try mod_perl where you can start by using your CGI scripts first.

Maxwell Troy Milton King