FastCGI - multi-threaded applicationRSS

2 replies

Last post May 16, 2013 11:16 AM by Adam Kozlowski

  • FastCGI - multi-threaded application

    May 09, 2013 04:13 AM|Adam Kozlowski|LINK

    Hi,

    According to FastCGI specification http://www.fastcgi.com/drupal/node/6?q=node/22 application can handle multiple requests over one single transport connection (simple speaking... per one process)

    “3.3 (…)
    All data that flows over the transport connection is carried in FastCGI records. FastCGI records accomplish two things. First, records multiplex the transport connection between several independent FastCGI requests. This multiplexing supports applications that are able to process concurrent requests using event-driven or multi-threaded programming techniques. Second, records provide several independent data streams in each direction within a single request.
    (...)”

    Are FastCGI modules for IIS (http://www.iis.net/downloads/microsoft/fastcgi-for-iis) able to handle FastCGI application that way ?

    I've checked several configuration on *nix environments and each of them can handle requests that way... (one application process can handle concurrent multiple requests so it's not necessary to spawn new process to handle concurrent request)

    - Apache + mod_fastcgi
    - Nginx (has native fastcgi support)
    - lighttpd + spawn_fastcgi

    Any help appreciated.

    /Adam

  • Re: FastCGI - multi-threaded application

    May 16, 2013 05:31 AM|Chen Yu - MSFT|LINK

    Hi,

    FastCGI for IIS enables popular application frameworks  that support the FastCGI protocol to be hosted on the IIS web server in a high-performance and reliable way. FastCGI addresses the performance issues inherent to  CGI by providing a mechanism to reuse a single process over and over again for many requests. It support many Requests.

    Reference: http://www.iis.net/downloads/microsoft/fastcgi-for-iis 

    Regards,

    Please mark the replies as answers if they help or unmark if not.
    Feedback to us



  • Re: FastCGI - multi-threaded application

    May 16, 2013 11:16 AM|Adam Kozlowski|LINK

    Hi

    Thanks for FastCGI definition.
    Next time, let everyone to go on Wiki page to find full encyclopaedic definition.

    Going back to the question...

    Does IIS FastCGI module implements things stated in fastCGI specification ?

    According to spec...
    “The protocol serves two purposes.
    First, the protocol multiplexes a single transport connection between several independent FastCGI requests. This supports applications that are able to process concurrent requests using event-driven or multi-threaded programming techniques.
    Second, within each request the protocol provides several independent data streams in each direction.”

    Is it possible to handle concurrent requests without spawning new application processes by IIS FastCGI module (or just to decrease number of spawning processes) ?

    There are two ways web server can play with FastCGI application to handle concurrent requests:
    1) create new process with application (of course if can, see “MaxInstances”)
    2) single application process can handle multiple requests (it's not necessary to spawn new process by web server). It can be done using multiple handle (preferred way) or by multiplexing requests.

    Is it possible to go into second way using IIS as a web server ?