skip to Main Content

I’m beginner of Perl.

My understanding is below.

  • FCGI is a protocol
  • It is a gateway interface between web server and web applications
  • The process keeps alive for specific period(such as 5 mins) and accepts multiple requests, so response is fast.
  • You cache some data before process is build so that you can share those caches with all process, and you can save memory by Copy-on-Write.

It looks nice.
However, I have never seen FCGI in my experience with modern development with Golang, Nginx or whatever.

Doesn’t modern web application require FCGI anymore?

What was the disadvantage of FCGI, and what is the still advantage of FCGI?

2

Answers


  1. If we say there are better alternatives/ways that will be proper statement instead of saying anything dead or alive. Still in 2021 I have seen code running with FCGI in production and its going good. The latest comment happens in 2019 in the github. Everything has a time frame. Being old doesn’t mean bad/dead, being younger doesn’t mean good/alive.

    For modern web development there are many frameworks available right now –

    1. Catalyst
    2. Mojolicious
    3. Dancer2
    4. Kelp
    5. Raisin

    Top 3 are most common ones. Mojo is mine personal favorite.
    You can use them with Plack/uWSGI and you are good to go in no time. They will take care of everything.

    Since you mentioned "FastCGI is a protocol" and it is not an implementation, it shouldn’t be specific to any language. There will be implementation across different language(maybe not popular). You can find them with single search. One example of Nginx

    There are various other questions asked before similar to this. Have a look at those. They will give you more clarity.

    Is there a speed difference between WSGI and FCGI?

    Is mod_perl what I'm looking for? FastCGI? PSGI/Plack?

    Perl CGI vs FastCGI

    Which is better perl-CGI, mod_perl or PSGI?

    Login or Signup to reply.
  2. To expand slightly on Maverick’s answer

    When writing a web application, there are two questions you need to ask yourself:

    1. What language/framework am I going to write this application in?
    2. How am I going to deploy this application?

    In the bad old days, the answers to the two questions were intertwined in annoying ways. You might write a CGI program originally and then switch to a different deployment environment (FCGI or mod_perl, perhaps) at a later date when you wanted better performance from your application. But changing to a different deployment environment would usually mean making a lot of changes to your code. The application needed too much knowledge about the deployment environment. And that made life hard.

    If you use the frameworks in the other answer, then things are different. Most (maybe all) of those frameworks run on top of a protocol called PSGI (Perl Server Gateway Interface). By writing your application using those frameworks, then your application will interact with the web server using the PSGI protocols. And there are PSGI adaptors available for all web deployment environments. So you can start by deploying your Dancer2 application as a CGI program (very few people do that, but it’s completely possible) and then move it to an FCGI or mod_perl environment without changing your code at all.

    I still see people deploying applications in FCGI. It’s certainly more common than using mod_perl these days. But, to be honest, the most common deployment environment I see is to set your application up as a standalone service running on a high port number and to use a server like nginx to proxy requests to your service. That’s what I’d recommend.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search