Actually, I think I discovered my own solution. It turns out by
hijacking Apache's normal role of serving files and delegating it to my
own PHP script, I've caused a bit of a confusion, and Apache still
attempts to answer requests for partial content, while my script is
only adept at deliver the whole thing from start to finish.
What ends up happening, I think, is that Apache will load the entire
file into memory, and then take care of the partial-content requests -
I don't know if it is successfully, because these requests are often
repeated, much to the dismay of my memory controller! This would
explain why the processes were maxing out at 140+MB - that is,
coincidentally, around the same size as the largest files I'm serving
up.
What I have to do is rewrite my entire routine to handle the HTTP
requests themselves, which shouldn't be amazingly hard - but it does
through a wrench in the works. I'll try and update this thread if I
finish my solution.
I apologize, again, if I am violating any of the rules or ettiquettes
of posting on this usergroup - I just imagine this issue might be a
concern for others as well that might be in a similar situation as mine.
Abu Hurayrah wrote:
Greets
to all!
I apologize in advance if I am violating some ettiquettes with regards
to this mailing list - I joined specifically because I have been
experiencing some strange behavior that is disrupting my server.
I've included three chunks of my server log that chronicle the requests
that relate to my problem, each one with some different information.
These are located at the end of my message (probably should be left out
of any replies)
Essentially, what is happening is some kind of a request is causing my
server's Apache's processes to mushroom in size - going from a normal
15 - 30 MB all the way up to 140+MB
And with 10 - 20 Apache processes running on a system with 1GB of RAM,
this can be a problem. : -D
The requests are occurring with a custom download script that I have
written, through which ALL download requests occur. I've optimized it
to use very little memory by reading in the files in small chunks. I
rarely have any problems except with requests that follow a specific
pattern. I thought the problem was in my script, but I highly doubt it
because I cannot duplicate it myself - plus "normal" requests, even a
barrage of them, trigger no issues whatsoever.
I was previously running Apache 2.0.52, but after reading up on it, I
discovered there was a security hole that caused a problem similar to
what I was having:
http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0942
So I upgraded to the latest release (2.0.54) - and I'm STILL having the
same problem.
The requests usually have a User-Agent string of the following:
"Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)". This is easy enough
to BrowserMatch out with an environmental variable, but not in every
case does this work.
I think I've talked enough, so I want to see if anyone else is
experiencing the same problem or not.
|