does fastcgi module support multi-thread fastcgi server? [Answered]RSS

4 replies

Last post Feb 25, 2009 02:36 PM by sanpei

  • does fastcgi module support multi-thread fastcgi server?

    Feb 24, 2009 09:58 AM|sanpei|LINK

    <div class="ForumPostBodyArea"> <div class="ForumPostContentText">

    i test some examples  with OpenMarket libfcgi on IIS 7, including the one (threaded.c) on fastcgi.com.

     though there are many thread created, but seems got a dead lock when get the lock.

     next i remove the lock code around ' rc = FCGX_Accept_r(&request);',but only one of threads can select/accept sockets and make right response.           

     btw, in IIS manager, i set to use TCP. with NamedPipe, all threads will idle at WriteFile(in os_win32.c), i think it caused by different thread read/write the same fileHandle, am i right?

    </div> </div>
  • Re: does fastcgi module support multi-thread fastcgi server?

    Feb 24, 2009 12:37 PM|anilr|LINK

    Since each fastcgi process will only receive one request at a time - making it multi-threaded is kind of pointless, right?  You can make it multi-threaded if you want, you still have to synchronize any data receives/sends.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: does fastcgi module support multi-thread fastcgi server?

    Feb 25, 2009 02:41 AM|sanpei|LINK

    thx for your reply.

    since use few process but more threads maybe faster and more responsibility on windows, is there any plan upgrading fastcgi mod to make fastcgi app process can accept more than one request from IIS fastcgi manager? then we can use threads for processing some requests (in queque with current version mod) at same time, with lower costs.

    with current version, is there any setting to keep min (always running) instances count?

  • Re: does fastcgi module support multi-thread fastcgi server?

    Feb 25, 2009 02:13 PM|anilr|LINK

    The main reason for the IIS fastcgi support is that the IIS CGI support is pretty slow and the ISAPI support does not work for techonologies that are used to single-threaded request processing on apache and are hence not thread safe (eg many 3rd party php libraries) - so the fastcgi support provides single threaded processing while improving performance by many orders of magnitude compared to CGI.  If you really wanted multi-threaded execution of requests, the ISAPI API (or the new IIS7 modules APIs) would be the one to consider rather than trying to get fastcgi to support multiple concurrent requests.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: does fastcgi module support multi-thread fastcgi server?

    Feb 25, 2009 02:36 PM|sanpei|LINK

    i see.

    thank you for your suggestion, and sorry for my poor english :)