简体   繁体   中英

MAMP Pro Apache Randomly Slow to Start Serving Page - Not a DNS Lookup Issue

I've found many posts on how DNS lookups are slow due to a Bonjour issue causing slow page load on OS X. I am quite certain that is not my issue since I am using valid live hostnames rather than *.local and Firefox tells me the lookups are instant. I also have local name resolution with the hosts file.

I've looked at the logs, cleaned up the minor issues and its still slow. As a test I put error_log("File_Update: START: ".date("H:i:s")) in as the very first line of the file and error_log("File_Update: END: ".date("H:i:s")) at the end as well as some throughout my php file thinking mySQL was the problem. The longest from start to finish is 1 second.

Randomly, when I load the page it takes as much as 10 seconds before the START log entry appears. At this point there is no database access and this is the first line of code executed by php. This problem started a few days ago and I do not recall making changes to my system. It happens with all pages and all sites as well as phpMyAdmin so it's not my code. This site is lightning fast on the production server.

I upgraded MAMP Pro from 2 to 3 and no difference. I've tried turning XDebug off and turning on php cache module. No difference

I'm running 2.33GHz Quad core i7 with 16G RAM, OS X 10.9.5, SSD.

I can post the logs if anyone wants to see them but the only thing there is startup info. Loading the pages only output my log entries for testing.

I'm asking for ideas on what to try next. Ten second page loads really slows down creativity.

Found the problem. Apparently it was a combination of two things. I have IceFloor installed however I did turn it off to test. That alone did not fix the problem.

I have two Thunderbolt displays so that adds several interfaces to the network control panel. I noticed that pings to one of my own addresses occasionally failed. This should not happen! I deleted all network profiles and started over. Now it's speedy again. My guess is since I have so many interfaces with two of them live to different connections to the internet, either IceFloor or OS X networking got confused.

Deleting all the network interfaces and locations and starting over fixed it.

Hope this helps someone else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM