[FASTCGI] IOCompletion Ports and FCGI application Questions
Martin Chapman
chapmanm at pixia.com
Tue Oct 20 16:17:37 EDT 2009
Bill / All,
I am currently implementing a fastcgi version of a server that I have on
windows. My existing server uses iocompletion ports to perform async io on
socket handles. I noticed in the file os_win32.c that you are using
iocompletion ports on windows in the fastcgi too. I have a couple of
questions:
1. If I use the fcgi defined functions defined in fcgi_stdio.h to read
and write data on the socket will the underlying fcgi functions use async io
to do this by default? I am assuming that is the case after looking at the
code but I wanted to make sure I don't have to do anything special in my
code to enable async reads and writes.
2. I like to use the optimized windows function TransmitFile() for
sending data across the network. Does fcgi take advantage of this function?
If not, is there a way to get a hold of the requesting socket handle from my
fcgi application so I can use that function instead of a fwrite() call? If
I did do that would it cause problems for the fcgi application framework?
3. I want to make my fcgi executable a single multi-threaded
application in order to cache my application resources. I am very familiar
with writing multi-threaded applications but wanted to know if anyone has
any tips or examples of the best way to do that with fcgi. My initial
thought is to create a pool of worker threads that is twice the size of the
number of processors of the machine combined with a second pool of http
requests received by FCGI_Accecpt(). My thread pool manager will broker the
incoming requests to the worker threads and let the FCGI_Accept() block when
my pool is full. Does this sound like a decent strategy or can I do better?
4. I want to support remote fcgi so I can move my application behind
the firewall and scale across 1 to n application servers. I don't need per
session support and my target web server will be Apache. What do I need to
do to make this work? I have read the docs on the fcgi website but I am not
totally clear on what needs to be done to make this work. Do I need to
spawn a listener thread for the remote application or is that handled by
fcgi? Should the remote servers be windows services so I can make sure they
are always avaiable? Has anyone used remote fcgi processes as services? Is
that a practical solution? I will be using TCP for my network
communication.
Best regards,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20091020/ac7474f3/attachment.html>
More information about the FastCGI-developers
mailing list