httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rasmus Lerdorf <>
Subject Re: [users@httpd] MaxRequestsPerChild, memory, and ps allocation
Date Fri, 30 May 2003 23:57:11 GMT
On Fri, 30 May 2003, Lynn Schaper wrote:
> Our testing shows that these processes grow when users upload and send
> attachments, and for some reason the memory is not released after that
> connection is finished.  We can accept that as a PHP feature/bug

It used to be the case that PHP we buffer an entire upload in ram before
writing it out to disk.  But that was fixed a while ago, and the fix is
most definitely in the version you are using.  I would have a look at the
user-space code that manipulates the uploaded file.  Perhaps it is reading
the entire thing into memory in order to copy the uploaded file out of the
tmp dir and into its final location.  The code should be using the
move_uploaded_file() function to do this.  That will simply do a rename()
(if possible) and if that fails it will try to copy it in 8k chunks.
If your code is already using move_uploaded_file(), then have a look at
what is being done with the file once it has been moved into the right
location.  It sounds a lot like you have a basic application-level problem
where something is loading the entire file into memory at some point.
I realize your question was regarding workarounds and not the problem
itself, but I much prefer to try to solve the real problem.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message