0
votes

I have an HTTP server and a client (I use curl for testing). The problem I have is that even the simplest, "ping" request takes 3-5 seconds to accomplish. I have run tcpdump on the server and it seems that after establishing TCP connection, the client (curl) waits 3-4 seconds for sending the HTTP request:

09:06:55.079376 IP client > server: Flags [S], seq 1639466412, win 64240, options [mss 1358,nop,wscale 8,nop,nop,sackOK], length 0

09:06:55.079457 IP server > client: Flags [S.], seq 2519785093, ack 1639466413, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0

09:06:55.087145 IP client > server: Flags [.], ack 1, win 1029, length 0

09:06:59.722060 IP client > server: Flags [P.], seq 1:83, ack 1, win 1029, length 82: HTTP: GET /ping HTTP/1.1

You can see the problem between 3 and 4 line of the tcpdump output.

Do you know what can cause this issue? Is this really on the client side or I should check also on the server side?

UPDATE If I use telnet to connect to the server's port and send GET, the server replies immediately.

1

1 Answers

0
votes
  • Flags [S] Syn
  • Flags [S.] - Syn Ack
  • Flags [.] - Placeholder, usually used for ACK.
  • Flags [P.] - Push Ack

  • Can you prepend time to your curl command? as shown below.

  • These hosts, is there latency between the two?

As a test on the same host (terminal):

terminal a $ python -m SimpleHTTPServer 8989

terminal b $ time curl -vvv localhost:8989 results look something like:

real    0m0.018s
user    0m0.006s
sys     0m0.005s

At this point its hard to say if this is client or server side, this depends on the data you are attempting to query. Can you share that query/curl command?