Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've noticed my web server takes a long time to load pages recently. Using Firebug, I realised it takes around 4s for the DNS lookup:

Connecting: 304ms
Sending: 0ms
Waiting: 3.45s
Receiving: 0ms

I thought that was a long time to wait for a HTTP response. In the command line, I initiated:

telnet localhost 80
GET / HTTP/1.1
Host: {IP Address}

And waited until these next three commands were returned before entering twice. The first command I used was to find out the port number:

lsof -p `pidof telnet`

Then, to find out the process:

netstat -nap | grep {port}

And finally:

strace -o /tmp/output -f -r -s4096 -p {PID}

I then pressed enter on the telnet command to return the request so that it would log in the output file. When the telnet finally returned I had a look at the output file and searched for the longest processes, which were:

6152      12.143817 read(17, "GET / HTTP/1.1\r\n", 8000) = 16
6152       0.000178 gettimeofday({1330023713, 143410}, NULL) = 0
6152       0.000169 poll([{fd=17, events=POLLIN}], 1, 60000) = 1 ([{fd=17, revents=POLLIN}])
6152      13.550608 read(17, "Host:\r\n", 8000) = 23

Does anybody know why these two processes are taking so long? Is it a DNS lookup issue? What should I do to address the problem?

share|improve this question

It took you 12 seconds to type "GET / HTTP/1.1\r\n" and 13 seconds to type "Host:\r\n". So the server spend that long reading them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.