On 8/2/05, Kamil Srot <[EMAIL PROTECTED]> wrote:

> Situation:
>     I have simple PHP script serving large files for autorized users...
> after some time, all memory of the server is consumed by httpd processes
> - their memory allocation does corelate with size of the files served...
> I tried to use several methods of output prom PHP, flushing of data,
> etc... it doesn't help... it seems apache does cache output of PHP into
> RAM with NO LIMIT of memory allocation... clear and relyable way how to
> reproduce the problem is ro resume broken download - Range headers seems
> to make apache allocate whole output into memory immediatelly

Indeed you have found the problem, I believe: Range headers.  In order
to handle out-of-order range requests (which are allowed by the spec),
httpd must buffer the entire response.  Of course, that is very bad
behavior.  Instead, httpd should just ignore out-of-order range
requests (which the spec also allows) and serve the entire thing.  And
it shouldn't be necessary to do the buffering when the ranges are in
order.  I know this has been discussed on the dev list, but I can't
remember the conclusion.  There is probably some way to get httpd to
ignore the range header, either using the RequestHeader directive or
using one of the special environment variables.  But I've never done
it myself.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to