>
> Gerald, thanks for your answer.
> I'm still confused... which is the right scenario:
>
> 1) a mod_perl process generates a response of 64k, if the
> ProxyReceiveBufferSize is 64k, the process gets released immediately, as
> all 64k are buffered at the socket, then a proxy process comes in, picks
> 8k of data every time and sends down the wire.
>

Yes, I am not quite sure if it get's release immediately, or if it has to
wait until the whole transmission is successfull.

> 2) a mod_perl process generates a response of 64k, a proxy request reads
> from mod_perl socket by 8k chunks and sends down the socket, No matter
> what's the client's speed the data gets buffered once again at the socket.
> So even if the client is slow the proxy server completes the proxying of
> 64k data even before the client was able to absorb the data. Thus the
> system socket serves as another buffer on the way to the client.
>

yes, too (but receive and transmit buffer may be of different size,
depending on the OS)

The problem I don't know is, does the call to close the socket wait, until
all data is actually send successfully or not. If it doesn't wait, you may
not be noticed of any failiure, but because the proxing Apache can write as
fast to the socket transmitt buffer as he can read, it should be possible
that the proxing Apache copies all the data from the receive to the
transmitt buffer and after that releaseing the receive buffer, so the
mod_perl Apache is free to do other things, while the proxing Apache still
wait until the client returns the success of data transmission. (The last,
is the part I am not sure on)

>
> Also if the scenario 1 is the right one and it looks like:
>
>             [  socket  ]
> [mod_perl] => [          ] => [mod_proxy] => wire
>             [  buffer  ]
>
> When the buffer size is of 64k and the generated data is 128k, is it a
> shift register (pipeline) alike buffer, so every time a chunk of 8k is
> picked by mod_proxy, new 8k can enter the buffer. Or no new data can enter
> the buffer before it gets empty, i.e. all 64k get read by mod_proxy?
>
> As you understand the pipeline mode provides a better performance as it
> releases the heavy mod_perl process as soon as the amount of data awaiting
> to be sent to the client is equal to socket buffer size + 8k. I think it's
> not a shift register buffer type...
>

That depends on your OS, but a normal OS should of course use a piplined
buffer (often it's implemented as a ring buffer, when the write pointer
reaches the end of the buffer, it continues to write at the start of te
buffer and stopps when it hit's the current read position in the buffer)

Gerald

Reply via email to