Forum Moderators: phranque

Message Too Old, No Replies

httpd stalling

         

gerolds

4:58 pm on Dec 11, 2004 (gmt 0)

10+ Year Member



Server version: Apache/1.3.27 (Unix) (Red-Hat/Linux)

The following behaviour of my httpd is driving me nuts:

Whenever a html document is requested that contains an embedded reference to a non-existant file, like an image, one more httpd process appears for each missing file. The process will stay alive until the server is restarted. After about 15 or 20 processes come to show up with "ps -ef ¦ grep httpd", the response to further page-request slows down extremely making the page unusable (browser-timeout).

Has anyone heard of similar symptoms, maybe know the cause or even a cure? Any pointers are greatly appreciated.

I dont know which background info on the server would aid in the diagnosis, so i didnt post any yet. But if you need to know anything, i'll post it.

sublime1

12:44 am on Dec 19, 2004 (gmt 0)

10+ Year Member



This is bizarre behavior. When you say "embedded reference" I assume you mean an img (or similar) tag, right?

In this case, the first request of the main URL by the browser will only return the main document, then the browser will find all the additional elements on the page that need to be downloaded (in other words, images) and make separate requests to the server for each. In each of these requests, the server should either return the file or just respond with a 404 (Not Found) which the browser will display as a broken link.

So the behavior you describe could happen if, for some reason the server thought the file was actually there but was doing something funny trying to find it. Each separate request is handled by a new child httpd. So, for example if some of your content was being handled by Tomcat or a script and Apache mistakenly thought the content was a script instead of an image it might forward the request to the script. If the script crashed or hung, for example, the httpd might not know something was wrong and would need to wait either until the server timed it out or the socket was closed or something.

Check to make sure that Apache knows to treat image files as just files. If it does, I would be surprised to see the result you are reporting. If you are doing any rewrite rules, turn on the rewriting log and make sure that Apache is not rewriting the normal image requests to something bizarre. If you are using Tomcat or some other servlet container, make sure the connector is not getting the image requests

For example, we use mod_jk and use the rewrite engine to pass through all page requests to be handled by Tomcat -- without making sure that we specifically identify images, scripts, css and other static content, they would get passed through to tomcat.

When all else fails, turn up your LogLevel and see if Apache can tell you what it is doing. Good luck :-)

gerolds

1:34 am on Dec 19, 2004 (gmt 0)

10+ Year Member



Thanks for the reply, it was,quite a good pointer to the problem.

The problem was this: the apache was configured to pass a custom-log to a script to be processed. This was a I/O monitoring script that basically did nothing else but add up a few numbers and save them to a file.

Somehow the apache did not properly terminate the "sub-threads" for image-requests properly because this script was missing. After i added the script again, everything was running smoothly again.