Hacker News new | past | comments | ask | show | jobs | submit login

> How many times can we download google.com in a second? Exact answer: 4

I was a little suprised by this one. Sure, network connections are are going to be much slower than local operations, but where's the time going? Is it mostly the network latency? Google has a lean webpage, so I assume it has nothing to do with google specifically.




I think those were synchronous requests one after another. 250ms per page load sounds about right.


This also surprised me. A large part of it I'm sure has to do with the fact that I'd assume (given these numbers) urllib2 auto follows redirection. The request is to `http://` so it must make an additional request. Otherwise I'd expect them to be much higher as there would be no 'body' to the responses.


If your average connection has 100 ms (50 ms would be extremely good but doable these days) of round trip latency to Google.com, then you have a hard upper limit of 10 loads per second just to connect to the system. Then you have to move the data, store it in memory, parse it, and run it.


I'd be shocked if my latency to Google were even as high as 50 ms. Though downloading http will take 3 round trips for http and four round trips for https which will add up if the connection isn't kept alive after each download.

Edit: just tested and got these numbers for myself:

7-13ms to ping google.com

50-80ms to curl http://google.com

90-130ms to curl https://google.com

140-160ms to curl http://google.com http://google.com http://google.com http://google.com http://google.com

180-220ms to curl https://google.com https://google.com https://google.com https://google.com https://google.com

So should be able to download something like 20-30 copies of google with keep-alive, and ~10 without.


You're absolutely right and speeds to Google have gotten much faster over time. For what it's worth, I just ran a quick ping test and got 26ms average latency to google.com so I should have checked before I posted. Thanks for keeping me in check.

Still this is dependent on where you are, your ISP, other general factors, and it's still within an order of magnitude which was the point of the "quiz"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: