I'm current working on a REST interface for an app, and sometimes I run into page loads which take exactly ten seconds longer than usual, mostly after the server has been inactive for a while. It can't be a programmatical issue, because after the first load, the load time is around 22ms. Then I leave it for a while and reload, and the response time is instead 10022 ms. It's quite consistent, always adding ten seconds to the standard response time.
There's nothing in the Apache logs or anything. I have no idea where to start troubleshooting this. Any help?
My local dev setup is Mac OSX (10.8.5) and Zend Server (I need it becaue we use Zend Framework at work...) MAMP stack.
Best regards, dimholt
EDIT: The answer here marked as correct explains why this happens randomly, but it also happened on every request when my laptop was not plugged in. I learned from my sysadmin that since the traffic is always routed through the (W)LAN-card anyway, when the computer is in power save mode, the card will try to always fill the buffer or wait for timeout before returning the response, thus adding ten seconds to my small REST requests.