Women in Technology

Hear us Roar



Article:
  The PHP Scalability Myth
Subject:   CGI model vs. in-process model
Date:   2003-10-17 11:40:23
From:   anonymous2
I hate it when people talk about "CGI model vs. in-process model" or whatever. Even if your interpreter (PHP, Perl, JSP, etc) is running "in-process", you're still using CGI (assuming that the user is sending data).


CGI is not about how the web server interacts with your program - it is how the web browser sends data to the server.


If you've got something like: http://mysite.org/foo.php?key=value


You are using CGI! Sorry, just one of my pet peeves.

Full Threads Newest First

Showing messages 1 through 7 of 7.

  • CGI model vs. in-process model
    2003-10-17 12:58:34  anonymous2 [View]

    Wrong.

    It's all about communication between the server and the program, and if you type something like:

    http://mysite.org/foo.php?key=value

    you have no idea if CGI is going on on the server. Could be the in-process model, or even something else. (Used to be, it was (almost?) always CGI).

    You need to read up.
    • CGI model vs. in-process model
      2003-10-17 14:18:16  anonymous2 [View]

      But doesn't the CGI specification define the environment variables and such the get your data (such as a GET query string ) into your script even if it is in-process?

      So, I was definitly at least half wrong but aren't you still using part of the CGI spec?
      • CGI model vs. in-process model
        2003-10-18 22:27:53  anonymous2 [View]

        Wow, I never realized so many people were confused about what CGI was. There is plenty of information on the W3C's Web site.

        The query string is defined by the URI specification, not CGI. Also, when two separate ideas use some of the same standards, it doesn't mean the ideas are equivalent. Otherwise, I'm sure you could logically argue that Java and PHP are the same thing.

        PHP can run as a CGI or as an Apache module (and in a few other environments). There is a substantial performance difference between the two.
    • CGI model vs. in-process model
      2003-10-17 15:17:31  anonymous2 [View]

      Uh, wrong!!!
      Ever hear of mod_perl or FastCGI? They are both in-process (using two totally different methods), but are still CGI at the core. The first poster was absolutely correct that it's how the client passes messages back to the web server.
      • CGI model vs. in-process model
        2003-10-18 02:20:22  anonymous2 [View]

        Ever hear of the CGI specification? It defines a series of environment variables which are to be made available to a CGI process and indicates how stdin and stdout of the process should be handled.

        It has nothing to do with the client; only the server-side program and the Web server. That's because the Web server is the program generating environment variables. Some data in those variables are obtained from the client, but what the client sends is defined by the HTTP spec, not the CGI spec.
  • CGI model vs. in-process model
    2003-10-17 13:38:13  anonymous2 [View]

    CGI is all about Communicating between your Webserver and an Server-side application and how to transfer the data. See http://www.w3.org/CGI/
  • CGI model vs. in-process model
    2003-10-17 18:43:58  anonymous2 [View]

    Yes, you're right, but at this late date what are we going to call the method of web scripting where the interpreter is re-started per http request? "PRIS" (Per Request Interpreter Startup)? "Out-process" invocation? I think we're probably stuck with "cgi".