I am running an apache web server on debian 6.0 with kernel 2.6.32-5-amd64.
In certain times of the day, usually when more people are online, the server have very slow responses. I am sure, that is not load, it is not DB, it is not PHP, accualy this command:
time wget 127.0.0.1
is quite slow:
--2013-09-20 15:36:49-- http://127.0.0.1/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-09-20 15:36:52 ERROR 404: Not Found.
real 0m2.663s
user 0m0.004s
sys 0m0.004s
Response time is up to 5sec. The point of waiting is after "HTTP request sent, awaiting response..." Page generating after this lag common for all http requests is fast, like 50ms.
I tested my web using http://tools.pingdom.com/fpt/, first response is always slow, most of content load is also slow but few are quite fast, but I cannot tell, if this tool have some sort of cache.
telnet 127.0.0.1 80
is fast, the response show without delay:
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Where can be the problem? It must be something before the request goes to apache.
Please tell me at least about some debugging tools for this.