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.