3

Just curious to know, is there any other alternative to cgi/fastcgi?

kalyan
  • 195
  • 2
  • 7
  • Your question is not clear! What do you mean by alternative here? – Khaled Nov 16 '10 at 08:47
  • For which scripting language? And why? Is there a particular disadvantage of cgi/fastcgi you're trying to leave behind? – ZoFreX Nov 16 '10 at 09:42
  • There is no disadvantage as such, i am exploring it and i do not have any experience with cgi. Was trying to figure out what else is available for use. – kalyan Nov 16 '10 at 10:50

3 Answers3

3

FastCGI is language/web server agnostic transport protocol, only alternative is SCGI, which for some reason is not as-popular as FastCGI, despite being simpler and cleaner and not losing in performance.

For different programming language and web server combination there are (often) faster alternatives available:

  • For python there is WSGI, which is implemented by mod_wsgi on Apache / uwsgi on Nginx and countless python app servers.
  • For ruby there is Rack, which is implemented by passenger for Apache / nginx .
  • For PHP there is mod_php (which is slower and thread non-safe) for Apache
Kristaps
  • 2,985
  • 17
  • 22
  • there's a lot of nonsense talked about PHP being non-thread safe: 7 years ago some PHP extensions were not known to be thread-safe. While several were updated quickly after that,I'm not aware of any outstanding issues - can you provide references? mod_php slower? Again - this is surprising news - can you provide references? – symcbean Nov 16 '10 at 13:12
  • As far as I see, PHP FAQ still says that it is not recommended to run PHP in threaded MPM in production enviroment - http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2 . – Kristaps Nov 16 '10 at 15:30
  • mod_php slowness - it consumes more memory, more MySQL connections, more network usage, and freeing more resources allows you to scale to more users :-) – Kristaps Nov 16 '10 at 15:36
2

Depends what you want to do. Apache (by default) does not rely on CGI/FASTCGI to execute PHP, Perl or whatever code you want. It integrate the execution of the server side code inside its own processes. It's probably more simply, but also heavier.

So, if you question is: Is there an alternative to FASTCGI to execute server side code outside of the webserver process ? Then I believe the answer is no if you are coding in PHP, Perl or C.

Julien Vehent
  • 3,017
  • 19
  • 26
  • Thanks, this helps. I just do not want endup doing something which is too outdated. – kalyan Nov 16 '10 at 10:52
  • Reply is a bit misleading: Apache does not have to rely on CGI/FASTCGI to run interpreters implemented as Apache modules. "...but also heavier" - in what way? There's only a disadvantage if the majority of the content is static then the memory footprint is a bit bigger than it needs to be (but these are ro TXT segments and therefore shared). – symcbean Nov 16 '10 at 13:08
0

If you're talking about PHP, there's mod_php for Apache.

ZoFreX
  • 308
  • 1
  • 3
  • 9