Re: How to get Apache to use simultaneous connections to my fcgi app?

David Birnbaum <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel,gmane.spam.detected
Message-ID <[email protected]>
Joe,

If you are using the library yourself, you need to handle forking/threading. 
Apache is going to block on the connect() back to your application.  So, you 
have do to the accept() into a child or thread, so the parent can pick up the 
next one.  You decide how many children to run at once.

If you use the FastCGI proc manager, it will do this for you with a pre-fork or 
load-based-fork model (see the docs).

David.

-----

On Mon, 20 Aug 2007, joe-QzMH92Wc/[email protected] wrote:

> We've got our fcgi application up and running, as an external
> application (since we only have easy access to TCP sockets, not Unix
> sockets).  However, we're observing that it only gets one connection at
> a time -- and the Request ID is always 1 -- even when we hit it with
> dozens of simultaneous requests (using the Apache Bench (ab) tool).
>
> The mod_fastcgi docs say:
>
> "The FastCGI protocol supports a feature, described in the
> specificiation as 'multiplexing', that allows a single client-server
> connection to be simultaneously shared by multiple requests. This is
> not supported. This does *not* prevent FastCGI applications from
> supporting multiple simultaneous requests over independent connections.
> Of course, the application has to be specifically designed to do so by
> using a threaded or select/poll based server model."
>
> Our app is designed to support multiple simultaneous independent
> connections.  But how do we tell mod_fastcgi that we do so?
>
> The FastCGI spec says that we should get a FCGI_GET_VALUES record, to
> which we can reply with FCGI_MAX_CONNS and FCGI_MAX_REQS.  But in
> actual testing, we never get a FCGI_GET_VALUES from the host.  The
> first record we ever see is a FCGI_BEGIN_REQUEST.
>
> So.  Can anyone explain what I must do to enable multiple simultaneous
> connections to my app?
>
> Thanks,
> - Joe
>
> --
> Joe Strout -- joe-QzMH92Wc/[email protected]
> Strout Custom Solutions, LLC
>
> ___________________________________
> fastcgi-developers mailing list
> http://fastcgi.com/fastcgi-developers/
>
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.