Why Nginx Doesn't Implement FastCGI Multiplexing?
mdounin at mdounin.ru
Fri Oct 4 16:48:40 UTC 2013
On Fri, Oct 04, 2013 at 09:43:41AM -0400, DevNginx wrote:
> I would also like to add a vote for FCGI multiplexing.
> There is no obligation for backends, since non-implementing backends can
> indicate FCGI_CANT_MPX_CONN in response to a FCGI_GET_VALUES request by
> nginx. The other poster has already mentioned FCGI_ABORT_REQUEST and
> dropping response packets from dangling requests.
> My scenario is that I have a variety of requests: some take a while, but
> others are a quick URL rewrite culminating in a X-Accel-Redirect. This
> rewrite involves complicated logic which is part of my overall backend
> application., which I would rather not factor out and rewrite into a nginx
> module The actual computation for the URL rewrite is miniscule compared to
> the overhead of opening/closing a TCP connection, so FCGI request
> multiplexing would be of great help here.
> If the overhead of a multiplexed FCGI request starts to approach doing the
> work directly in an nginx module, it would give a valuable alternative to
> writing modules. This would avoid the pitfalls of writing modules (code
> refactoring, rewriting in C, jeopardizing nginx worker process, etc.).
Your use case seems to be perfectly covered by a keepalive connections
support, which is already here. See http://nginx.org/r/keepalive.
More information about the nginx