Bill Stoddard wrote: ... >Solve the problem to enable setting aside the open fd just long enough to check for a >pipelined request will nearly completely solve the worst part (the mmap/munmap) of >this >problem. On systems with expensive syscalls, we can do browser detection and >dynamically >determine whether we should attempt the pipelined optimization or not. Not many >browsers >today support pipelining requests, FWIW. > >
A really simple variant of this would be to handle the keepalive case by just saving the entire brigade (minus the EOS), the same way we save the brigade currently if it consists of a bunch of small buckets from mod_include that total less than 8KB. In the non-pipelined scenario, the core_output_filter() would be invoked again almost immediately (when read returned EAGAIN), and from there its existing logic would handle the sendfile on the saved file bucket. (The only catch, of course, is that the file bucket turns into an mmap bucket during the ap_save_brigade(). We'd have to change the file bucket setaside implementation to hand off the fd from the old pool to the new one, the same way we did with mmap buckets last year.) --Brian