[ic] question on mod_interchange socket closing (different from previous question)

Kevin Walsh interchange-users@icdevgroup.org
Sat Nov 2 19:26:01 2002


Jeff Dafoe [jeff@badtz-maru.com] wrote:
> 
> Ok, here is what drove me to look in there in the first place.  What if
> mod_interchange buffered the data coming back from IC, closed the IC socket,
> and then fed the buffered data to the apache client?  That means that IC
> processes would not be held open for slower clients thus potentially gaining
> a tremendous performance increase in terms of the amount of clients IC could
> service on a single machine in a given time frame.  The only negative thing
> I could think of would be that the mod_ic would potentially use a little
> more memory.
>
> This would give mod_interchange another major benefit over a *link or
> modperl installation and would add another substantial reason as to why IC's
> daemon-based design is ideal.
> 
Mod_interchange would have to pre-allocate a large buffer in order to
receive the body text.  Unfortunately, there's no way of knowing how
large to make this buffer;  The server could be sending a 20k HTML file
or could be sending a monster 700MB CD image.

We could read from Interchange and relay to the client in chunks but
we would still be blocking and, in my opinion, this would introduce
extra complexity and inefficiency.  We couldn't close the Interchange
socket until all of the data has been received and forwarded, and we
wouldn't know that there's nothing left until we read zero bytes from
Interchange in the next chunk.

I think that, as long as Interchange is reserved for HTML/text content
and the pages are reasonably small, there's no need to buffer the body.

For best performance, I recommend that Interchange runs in PreFork (RPC)
mode and sufficient servers are spawned to handle the expected demand.
I also recommend that large files, such as soft-product downloads and
Images etc., are handled by Apache rather than served by Interchange.

Feel free to send me patches for mod_interchange.  I'll look them over
and give you my opinion.  If you run tests and come up with comparison
benchmarks for mod_interchange, mod_perl, vlink and tlink, I'd be
interested to see those too.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/