On Mon, 9 Nov 2009, Graham Leggett wrote:
Akins, Brian wrote:
FWIW, nginx "buffers" backend stuff to a file, then sendfiles it out - I
think this is what perlbal does as well. Same can be done outside apache
using X-sendfile like methods. Seems like we could move this "inside"
apache fairly easy. May can do it with a filter. I tried once and got it
to filter "most" backend stuff to a temp file, but it tended to miss and
block. That was a while ago, but I haven't learned anymore about the
filters since then to think it would work any better.
Maybe a mod_buffer that goes to a file?
mod_disk_cache can be made to do this quite trivially (it's on the list
of things to do When I Have Time(TM)).
In theory, a mod_disk_buffer could do this quite easily, on condition
upstream writes didn't block.
I'm guessing that this would be the good-looking implementation of my
ugly-but-working making-disk-cache-work-for-large-files patchset
(version for 2.2.9 at
https://issues.apache.org/bugzilla/show_bug.cgi?id=39380, I'm in the
process of respinning it for 2.2.14 but ENOTIME makes testing slow).
The main issue I had when cobbling that together was to deal with the
fact that stuff<tm> wants to block, and it really isn't obvious in the
current httpd core how to do this nicely when you have a one-to-many
situation.
As you might remember, I "solved" it by spawning a thread to deal with
caching files in the background when needed. Since our usecase is
delivering static files it works, but it sure would be nice with an
infrastructure that tried to help you instead of being damn near
hostile at times.
/Nikke
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se | ni...@acc.umu.se
---------------------------------------------------------------------------
Quantum Trek: Time travel with a twist!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=