Long delays in accessing some sites on my server

Discussion in 'Apache' started by cleflore, Apr 28, 2009.

  1. #1
    Hello, newbie admin here. I more inherited this than configured it, so please bear with my lack of knowledge :) This is all with an Apache server on Ubuntu OS.

    Recently, some of the sites on a server I have setup here have started responding very slowly. This happened at about the time the network was reconfigured (I had nothing to do with the network configuration and know very little about it), so I'm pretty sure that was the catalyst. At any rate, what's happening is that some of the sites on my server respond immediately, while others are extremely slow (even over the LAN). Investigating the access_log file, I see that there are exactly 20 seconds between each pair of GET operations -- there will be two requests for, for example, a pair of images displayed on the site, and then 20 seconds later, the next pair.

    This is only true for certain sites. It doesn't seem to matter what sort of site it is -- most of the sites run PHP and MySQL, many of them using the same core code files, but they respond at different rates. I've checked file permissions, groups, and users -- changing them does nothing (I've made some of the slow sites have the exact same users and permissions as the fast sites, but to no avail).

    I'm almost certain there's some kind of timeout happening here, but I can't for the life of me figure out what could possibly be timing out. Any ideas? I'd be happy to provide what information I can, although getting specific info about the network setup might be challenging.
     
    cleflore, Apr 28, 2009 IP
  2. SSANZ

    SSANZ Peon

    Messages:
    861
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi

    Check out the DNSreport - google it. It will show any problems with the DNS, sounds like it could be a DNS issue.

    Also, are you running any cache mods with apache?
     
    SSANZ, Apr 28, 2009 IP
  3. cleflore

    cleflore Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi SSANZ,

    One of the domains shows a couple errors on DNSreport, but the other does not.

    Something too, for where I have multiple sites on the same domain, some will respond slowly (20 second delays) and some will not. For example:

    site1.mydomain.com
    site2.mydomain.com

    site1 will respond just fine, but site2 (as of recently) has 20 second delays on loading each thing. There are numerous sites on this domain; some respond normally, some do not.

    If you'd like to know the errors on the one domain, they're these:
    Fail - All nameservers report identical NS records, All nameservers respond, Missing nameservers 2.
    Warn - Glue at parent nameservers, SOA REFRESH value.

    The site with the failures uses a different service than the other for domain registration (there is only one site on that domain, the www). It happens to be one of the ones responding slowly, but it is not the only one. Some sites on the other domain are also slow, and the DNSReport is all good (except for a Glue at parent nameservers Warn).

    As far as cache mods go, I'll check into it. I'm not aware of any, but that doesn't mean they weren't loaded :)

    Also, when I load the sites over the LAN, I have to use the IP address directly (via modifying the hosts file in Windows) to access them, as the internal IP is different. I have the same problem inside the LAN and outside.

    Thanks for the help!
     
    cleflore, Apr 28, 2009 IP
  4. cleflore

    cleflore Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Okay, here's a list of everything in mods-enabled:

    cgi.load
    dav_fs.conf dav_fs.load
    dav.load
    dav_svn.conf dav_svn.load
    mod_python.load
    perl.conf perl.load
    php5.conf php5.load
    rewrite.load
    ssl.conf ssl.load
    userdir.conf userdir.load

    There are several cache mods in available, but none in enabled.
     
    cleflore, Apr 29, 2009 IP
  5. cleflore

    cleflore Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I have found the problem, but I'm not sure what the solution is. The problem is the .htaccess files -- the slow sites are using them to deny access to certain types of files (such as .inc files included by the php scripts). It's using deny from all rather than using any specific hostnames, but even still, it looks like that's causing reverse DNS lookup, which is going to timeout every time with the current network configuration.

    Is there a solution to this? I'd like to still be able to use .htaccess files, but I can't really change the network configuration.
     
    cleflore, Apr 29, 2009 IP
  6. cleflore

    cleflore Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    The solution was to move those directives to the httpd.conf file and get rid of the .htaccess files. I don't know why it works without slowdown in httpd.conf and not in .htaccess, but there it is.

    Hope that helps someone who runs into a similar oddball problem.
     
    cleflore, Apr 29, 2009 IP