Re: Strange user-agents and requests causing Apache processes to explode!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strange user-agents and requests causing Apache processes to explode!

Abu Hurayrah
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.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strange user-agents and requests causing Apache processes to explode!

Joshua Slive
On 4/25/05, Abu Hurayrah <[hidden email]> wrote:

>  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.

That is a possible explanation.  There was some discussion of this
issue on the dev list a while back, but I'm not sure what ever happend
to it.  That is certainly not good behavior on apache's part.

One other possibility for you is to try to use some of the
BrowserMatch variables (downgrade-1.0, force-response-1.0) to get
apache to stop doing byte-range responses.

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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strange user-agents and requests causing Apache processes to explode!

Abu Hurayrah
Joshua Slive wrote:

>On 4/25/05, Abu Hurayrah <[hidden email]> wrote:
>  
>
>> 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.
>>    
>>
>
>That is a possible explanation.  There was some discussion of this
>issue on the dev list a while back, but I'm not sure what ever happend
>to it.  That is certainly not good behavior on apache's part.
>
>One other possibility for you is to try to use some of the
>BrowserMatch variables (downgrade-1.0, force-response-1.0) to get
>apache to stop doing byte-range responses.
>
>Joshua.
>
Joshua,

Thank you very much for the feedback.  Where can I find out more about
how to change Apache's response behaviors?  It would be very helpful if
I could actually disable certain abilities in the meantime while I
resolve this issue via PHP.

---------------------------------------------------------------------
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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strange user-agents and requests causing Apache processes to explode!

Joshua Slive
On 4/25/05, Abu Hurayrah <[hidden email]> wrote:
> Thank you very much for the feedback.  Where can I find out more about
> how to change Apache's response behaviors?  It would be very helpful if
> I could actually disable certain abilities in the meantime while I
> resolve this issue via PHP.

Try:
http://httpd.apache.org/docs-2.0/env.html#special

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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...