Apache – Resolving Page Request Issues on Local Apache on Windows XP

apache-2.2PHPwindows-xp

I have Apache 2.2.11 installed locally on my Windows XP (SP3) dev machine, which I setup about 3 months ago.

I have just started having a strange problem in the last few week.

Apache is serving some basic PHP applications like phpMyAdmin. When I make a page request, Apache appears to not finish serving all resources for that page. Firefox shows the "Transferring data from servername…" message, and the page never completes. The same problem happens in Internet Explorer too.

I can sometimes tell which resource it is waiting on, because most of the page will render except for some image or similar resources. (Not sure why Firebug doesn't show this)

It doesn't have the problem every page request – for page requests where most of the resources are cached in my browser, the page request will work with no problems. Or pages that are very light will work with no problems.

However, if I "hard" refresh the page, I will have this problem (probably because it is requesting all page resources)

Does anyone know what this could be?

It is so strange that it has only just started happening – and I did not make any changes to my system (that I am aware of)

I tried playing with the Apache ThreadsPerChild setting, but it did not seem to make a difference.

UPDATE:

I have been doing some more tests. I have been serving the most basic of pages, just a plain HTML file:

<html>
<body>
    <h1>testing</h1>
</body>
</html>

If I request this page multiple times in a row, AND each request occurs immediately after the previous has completed, then 50% of the time the request will time out.

However, if I put a 1-2 second gap between requests, then there is no problem.

This correlates to what I have observed when the brower requests a real application page. When the browser has nothing cached, then all of the page resources are requested from the browser in a short amount of time – this appears to trigger the problem.

UPDATE2:

Nathan Long has helped me understand the issue a little better with the server-status page (see below).

It is weird, it is like the server has a hickup sending data to the client. The client sits there waiting forever for data that never arrives. Closing the client process does not terminate the connection on the server – the server still has active threads for each previously attempted connection, but they just sit there – not sending any data and never terminating. (even though the client is now closed) Only a restart of the server seems to terminate them.

Best Answer

Update - Fixed!

William Rowe from the Apache mailing list gave me the answer, which apparently is a known thing.

XP [personal operating system] only supports two simultaneous applications of the TransmitFile API. Please try the 'stock answer' of 'EnableSendfile Off' in your config.

With that change, this issue has disappeared for me.

Original Answer

Having the same problem - using Apache 2.2.14 on Windows XP. I had to use a slightly longer (but still very basic) static HTML file to get the load problem, but it does happen.

I just enabled the localhost/server-status page using conf/extra/httpd-info.conf (you have to enable a couple of modules in the main config file, too) and I noticed that each time the loading problem happens, the number of requests being processed goes up by 1, and the number of idle workers goes down. This is true even if the 'infinite load' is on the server status page itself - I hit refresh, and it loads successfully and instantly, with one more request being processed.

Each of the requests being processed shows a status of 'sending reply.'

I also turned on ExtendedStatus in httpd.conf, and now I see detailed info on each request being processed. Many have been in progress for several minutes, and many of those have transferred 0.0 kilobytes since starting.

I'm not sure what to make of this.

Detailed Instructions for server-status

You can make a server status page available at http://your.server.name/server-status by doing the following:

1) Enable mod_status and mod_info (for additional info) in httpd.conf

2) Also add Include conf/extra/httpd-info.conf, OR add the following directives (which is what httpd-info.conf contains):

# Turn on server status
<Location /server-status>
   SetHandler server-status
   Order Deny,Allow
   Deny from all
   Allow from localhost
</Location>

# Enable more status info
ExtendedStatus On

3) Restart Apache and load the status page.