1

Am having the strangest issue with an apache/PHP instance (PHP 5.2 in this case), where it will take over a minute to respond to a request. The PHP profiling is saying it's taking less than a second to actually generate the response, there just seems to be something in the way blocking. The browser network activity inspector doesn't give any clue either, as it's just saying the time to receive the first byte is 50-70 seconds. Any other suggestions to see what is causing the issue?

I'm debating wiping everything out and starting over, but would rather find out what the issue is since everything appears to be configured correctly, and I didn't do anything differently than normal. Thanks for any thoughts!

4
  • Please clarify ... respond to a request, I assume you mean a HTTP request via a browser? What are you requesting? Does this happen if you request an image or other static content from the same server? Does this happen if you pull a simple php script such as phpinfo or hello world script? Dec 6, 2011 at 20:36
  • Curious of how it responds to requests for an .html page.
    – Tim
    Dec 6, 2011 at 20:37
  • Digging into it a bit deeper, and it seems to only be happening for one virtual host. I've changed index.php to just a phpInfo(), and also tried accessing a .html page, and both are causing the issue. Also tried a couple different browsers to make sure this was not the problem. The virtual host is just a standard one, and once it takes a minute to load refreshes will be quick for about a minute (even with changes to the page so it's not a browser cache), then the delay comes back.
    – Brian Hogg
    Dec 6, 2011 at 20:46
  • Actually it seems to be every virtual host just at different times, and still can't see what is causing the delay. Just not seeing a pattern to what part of the stack is causing the problem, très frustrating.
    – Brian Hogg
    Dec 6, 2011 at 21:06

1 Answer 1

1

Turns out it was an issue with /etc/hosts - for whatever reason OSX Lion 10.7.2 has issues with putting multiple domains on the same line, for example:

127.0.0.1    mylocalsite.com anotherlocalsite.com

versus:

127.0.0.1    mylocalsite.com
127.0.0.1    anotherlocalsite.com

By putting them on the same line, pinging anotherlocalsite.com would take a minute to resolve, whereas mylocalsite.com would instantly resolve to 127.0.0.1. There's discussions on various issues with DNS and the hosts file on OSX Lion such as:

http://www.justincarmony.com/blog/2011/07/27/mac-os-x-lion-etc-hosts-bugs-and-dns-resolution/

If anyone knows why this particular problem is happening would be interested to know, but at least the problem is now solved!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .