Non-buffered backend
Martin Schut
nginx at wommm.nl
Mon Dec 3 23:27:11 MSK 2007
Hi all,
First an easy question: what is does the postpone filter do? I can't find
it in the docs.
On the next questions:
My current understanding of the webserver to send the response goes along
the following lines (I haven't spent much time reading the source yet):
1. nginx receives the stream to send from the back-end, be it a static
file or one of the other back-end means and buffers this until this
streamis closed
2. nginx routes the stream through all the need modules
3. nginx sends the stream to the client
I've a few questions regarding this:
a. Are 2 & 3 indeed seperate steps or will everything be sent as soon at
is processed in chunks (as I actually expect).
b. Is it possible to not transfer control to next module (with
ngx_http_next_*) but to request more chunks (maybe return with NGX_AGAIN?)
c. What I actually would like to try (in a few weeks) is to skip the
buffering step between 1&2. I see 2 options for this: I. buffer a small
amount then call the modules and wait until I receive a request back for
more info. This has the disadvantage that the backend can not send it's
response at the highest rate possible if the modules are not fast enough);
II. Use 2 threads, the first to read from the backend and the second to
immediatly start feeding the stream into the modules. Any opinions about
these options and the possibility to implement this in nginx. Or maybe a
third possibility?
Best regards,
Martin Schut
More information about the nginx
mailing list