[REBOL] Re: About FastCGI
From: holger:rebol at: 3-Jul-2001 13:53
On Tue, Jul 03, 2001 at 08:36:34PM +0200, Petr Krenzelok wrote:
> uhm, now I am confused - FastCGI native mode (described as "dynamic" mode in
> fastcgi dos) uses multiplexed connection?
No, not multiplexed connections (actually, in theory FastCGI can do that, but
most server plug-ins don't). I said "multiplexing over ports". With FastCGI
in native mode your script waits on a port and can accept multiple connections
in parallel, and handle them simultaneously. This can be useful if each request
needs to fetch data through other TCP or UDP ports. You could dynamically
build wait blocks which contain the FastCGI listening port, all active
FastCGI data ports and all secondary ports you created, to multiple over all
pending FastCGI requests.
> The docs distinguish three
> states -
> - static mode - only when FastCGIServer directive is used - you can specify
> amount of instances Apache will preload once it starts ...
> - dynamic mode - you don't need to specify anything - it's default mode
> (probably CGI compatible too) - Apache loads/kills instances of fastcgi
> servers (rebols) according to FastCgiConfig directive
These two are identical except that one preloads instances of the server and
the other one does not. Both pass local sockets through stdin and probably
only work in Unix. They are intended for use with "CGI comptability mode"
> - external mode - FastCgiExternal mode - Apache doesn't care of your
> servers, it assumes they are running ...
This one communicates through TCP sockets. The server can even be on a
different box. For FastCGI native mode.
> Am I correct or wrong? In what way does Apache (fastcgi process manager)
> communicate with Rebol, once in default mode? I saw some strange code in my
> error log - I posted it here few days ago and it seemed to me Rebol is
> listening even in default mode? "open fastcgi://" was part of error
> message, - but no listen port specified ... it would result in error, once I
> would try to use such piece of code in console :-)
> ->> ble: open fastcgi://
> ** Access Error: Invalid port spec: none
> ** Near: ble: open fastcgi://
> Could you explain a little bit of Rebol internals here, please :-)
Not much to explain :-). With the "-c" (or "--cgi") option REBOL is smart
enough to distinguish whether it was started through CGI or FastCGI ("static"
or "dynamic" in Apache lingo, not "external"). In the case of regular CGI
REBOL gets the CGI environment from environment variables. In the case of
FastCGI REBOL creates a fastcgi:// port (no port number means stdin is used),
waits for the first connection on it, and gets the FastCGI environment from
> Why isn't it possible to have non-blocking 'insert with ODBC?
I'll let Sterling answer that. AFAIUI the ODBC API provided by Microsoft
does not provide proper, compatible support for asynchronous operation.