HowTo FastCGI

Alex Efros <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel,gmane.spam.detected
Organization asdfGroup Inc., http://powerman.asdfGroup.com/
Message-ID <[email protected]>
Hi!

Is there exists howto/best practices documentation for FastCGI newbies?

Current situation with FastCGI is unclear for newbies, and that sort of
documentation will be very helpful. Here is some information I have after
researching and some questions. If somebody correct/approve that
information and answer to my questions, we can make this into howto for
newbies.


Information
-----------

Nowadays FastCGI usually used with 3 web servers: nginx, lighttpd and apache.
First two has native support for FastCGI.
Situation with apache is different:
- Original mod_fastcgi is not supported for many years, and it fail to
  compile with apache 2.x.
  * It's possible to compile original mod_fastcgi for apache 2.0 using patch:
    http://www.fastcgi.com/archives/fastcgi-developers/2005-December/004060.html
- There exists alternative: mod_fcgid, but it support only one type of
  FastCGI application: 'dynamic' (original mod_fastcgi also support 'static'
  and 'external' application types). It asserted that it use better
  process control than original mod_fastcgi, so it has sense to use it if
  you need only 'dynamic' FastCGI applications.

Looks like 'external' type is superior to other types:
- It's compatible with all these web-servers, so you shouldn't worry which
  web-server will run your application.
- It more scalable, because you can run your application and web-server on
  different servers.
- You've better control on starting/restarting your application and
  process management (amount of simultaneous copies running), and tuning
  this doesn't require any changes in web-server configuration.
- You can restart web-server without restarting your application.
- With apache, it's more secure and intuitive to run FastCGI application
  from usual user's account, than use any wrappers like SuEXEC or CGIwrap.
The downside: in apache case you have to use unsupported mod_fastcgi.


Questions
---------

How correct/stable mod_fastcgi with apache 2.x (using patch above)?
Support for mod_fastcgi was removed from Gentoo Linux, in favor of mod_fcgid,
but I've no idea is that happens only because mod_fastcgi isn't supported
by upstream anymore, or because there some issues exists with mod_fastcgi
and apache 2.x.

I've heard about some issues with FastCGI, which was very hard to debug:
- Sometimes user receive error from web-server, while FastCGI application
  don't received user's request. Pressing 'Refresh' usually solve issue
  for user.
- Sometimes under very high load user requests just freeze, and, again,
  FastCGI application don't received user's request. Probably this is
  related to some configuration like amount of simultaneous requests, etc.
So, what's the current situation with these or similar issues? I mean, if
such issues happens from time to time, it very hard to debug them, and in
case apache/mod_fastcgi there no chance to get fix/support from upstream...

There a lot of perl modules for FastCGI support on CPAN. Most of them is
4-7 years old and also looks not supported anymore. Which one is better to use?
Or is there exists another recommended way to run FastCGI perl scripts
(for ex. using some external utilities)?

About using unsupported mod_fastcgi with apache to use 'external' FastCGI
application type. I've been thinking about developing 'dynamic' FastCGI
application (to run with mod_fcgid), which will proxy request/response to
external FastCGI application. Another option - develop simple module for
apache in perl (to run with mod_perl), which will work just mod_fastcgi
but will support only 'external' FastCGI application type.
What you think about these solutions: is they have sense (i.e. is there
any known issues with using unsupported mod_fastcgi) and is there already
exist solution how to use 'external' FastCGI application without mod_fastcgi?

If anybody knows, what was the reason to drop mod_fastcgi support?
And why nobody fork mod_fastcgi and continue it development for so many years?


-- 
			WBR, Alex.
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.