0

I just started playing around with a hosted VPS (running Ubuntu). I let it run the simplest Go server that listens to port 8080 and returns "hello world" on path /hello. Then I started sending requests with my browser and I'm kind of puzzled by the response times.

A simple request to myip:8080/hello can take up to 170ms, which seems a lot to me. Here's the Fiddler report:

== TIMING INFO ============
ClientConnected:    15:28:21.356
ClientBeginRequest: 15:28:21.358
GotRequestHeaders:  15:28:21.358
ClientDoneRequest:  15:28:21.358
Determine Gateway:  0ms
DNS Lookup:         0ms
TCP/IP Connect: 0ms
HTTPS Handshake:    0ms
ServerConnected:    15:28:21.360
FiddlerBeginRequest:    15:28:21.360
ServerGotRequest:   15:28:21.360
ServerBeginResponse:    15:28:21.523
GotResponseHeaders: 15:28:21.523
ServerDoneResponse: 15:28:21.523
ClientBeginResponse:    15:28:21.523
ClientDoneResponse: 15:28:21.523

Overall Elapsed:    0:00:00.165

Even a request to some unexisting path like myip:8080/hello2 takes around the same time, of course returning 404.

On the other hand, if I make the request to another port (that the Go server does not listen to), like myip:8081/hello, the response (403) is istantaneous, around 7ms.

My question is: what happens exactly in the remaining time? Why is the Go server taking so much time to say "hello world" or even to return a 404? I'm sorry if the question looks trivial but I didn't know who else to ask and Google was not very helpful.

  • 1
    What are the specifications of this VPS? – Michael Hampton Sep 09 '15 at 20:23
  • @MichaelHampton it's an instance of the smallest droplet on DigitalOcean (512 RAM, 1cpu, 1TB transfer, they don't provide many more details), running Ubuntu 14.04.1. There's absolutely no load on the server except for this little test app. – splinter123 Sep 10 '15 at 07:56

0 Answers0