Apache - resources randomly freeze (resulting in slow page loads)

Random HTTP requests for resources β€” about 1 to 5% of the time (per resource, not per page load) β€”take a very long time to be delivered to the browser (~ 20 seconds), and often hang indefinitely. (Server information is listed below).

This leads to the fact that every fifth request to a page hangs because the JavaScript resource hangs in the <head> .

Resources are css, js and small image files that are directly processed by apache (without a scripting language), although loading pages (including PHP or Rails) also rarely freezes with equal chances, like any other resource (1-5% of the time) , so this seems like a problem with the Apache request.

Additional Information:

  • I checked inactive workers for server-status and, as expected, I still have 98% of my non-working employees. Although this can make a difference, since the hang is applied to static resources that are not served by FastCGI (resources are static). A.
  • I am not the only one with this problem. Someone else has the same problem with a different IP address.
  • This happens both in Google Chrome and in Firefox as HTTP clients.
  • I tried constantly forcing to update the same JS file in a new tab. This eventually led to the same kind of hanging.
  • The Timing tab for Google Chrome reports waiting for 34 ms and 19.27, receiving one of these requests for hanging. Would this mean that Apache already had the contents of the file ready, only it had delivery problems in a reasonable amount of time?
  • error.log does not show any errors. There are some expected 404 and 500 errors in error.log, but they are not related to freezing; these are actual errors for non-existent pages and fatal PHP errors.
  • I get some suspicious responses to partial content 206 mainly for static content, although it freezes more often than partial content. Basically, I get 200 OK responses all over the world, and I can confirm unspecified hangs on resources that were listed as 200 OK in apache access.log.
  • I have mod_passenger installed for Redmine. I do not know if this helps, but it is suspicious that this server is installed unlike all other servers with which I worked. Although mod_passenger should not affect static content, especially not in a folder with a non-ruble project, should it?
  • The server uses Apache 2.4 Event MPM on Ubuntu 13.10 hosted on Digital Ocean.

What can cause these curls and how can I fix it?

+8
ubuntu apache digital-ocean
source share
1 answer

I had the same problem, so after reading this thread, I tried setting KeepAlive Off in my apache configuration, which seemed to help - all resources were waiting for a timeout Now.

Not a great fix, but at least I'm one step closer to finding out the reason, and the pages don't take 15 seconds to load on average.

0
source share

All Articles