aggregating multiple upstream responses before finalizing the down stre am request

Daniel Chapiesky dchapiesky at juno.com
Fri May 16 20:43:45 MSD 2008


> I believe it could be possible, but you will have to face with a very complex
> problem: the HTTP scheme: request -> reply will be broken and Nginx is an 
> asynchronous server so it's not so easy to manage errors when parallel 
requests are evolved.


True...

Yet, as I understand the code...

A request comes in... nginx determines it is to be forwarded to an upstream 
server... the request is appended with request->upstream and the chain of 
responsibility leads to the upstream module connecting to the upstream 
server.  The request is held in the queue until the upstream module releases 
buffer chains and/or finalizes the request... the upstream connection receives 
the upstream response and stores them in it's own buffer chain.  

The process is asynchronous since as chunked responses from the upstream 
arrive and when the open request is examined again, the upstream module 
transfers from one to the other...  

I'm thinking that I should look at using the upstream round robin module as my 
code base....   Essentially I am letting multiple upstream connections be 
created and the round robin module already has the code for dealing with 
failed connections.

Thanks for the CRC concept...  The batch mode doesn't work for this problem, 
but a SHA1 of the two responses makes comparision much faster.

Thanks for your input - it has helped me look at the problem with a different 
perspective.

Daniel








More information about the nginx mailing list