The place's the quickest place to place my server? How a lot does it matter? Utilizing my very own web server accesslogs and public latency data to get a quantitative reply and why roundtrips are such a ache. As neighborhood latencies develop, uncommon points can happen: "fat" websites can turn out to be quick (particularly if served totally from CDN) and "skinny" web sites that use APIs can turn into gradual. I've assumed forty megabit bandwidth, TLS, latency to CDN of 40ms and no current connections. To estimate what the theoretical best bodily place to place my very personal server is I've blended publicly on the market information on latencies with my very personal web server accesslogs. I am aiming to get a tough, quantitative, reply that's based mostly on an precise data set. Time taken to traverse the web is added to the time taken to reply a request. 130 milliseconds for the response. It's a bit worse than merely 130 milliseconds. Relying on what a consumer is doing they may end up making a variety of these roundtrips.
Within the occasion that they should make that choice with the one actual objective of decreasing latency, the place ought to they decide? 1. I took my very personal accesslogs for a two week interval in September simply after I would printed one thing new. I purchased about one million requests all through this interval from 143k distinctive IPs. 2. I used Maxmind's GeoIP database to geocode each IP sort out in these accesslogs to geographic co-ordinates. 4. I mapped these cities (semi-manually, which was fairly painful) from their names to Geonames ids - which gave me co-ordinates for the cities. 5. Then I loaded the entire above right into a Postgres database with the PostGIS extension put in so I'll do geographical queries. 6. I queried to estimate how prolonged, by percentile, requests would have taken if I would had my server in each of the 200 cities. Within the desk beneath I've recorded the tip outcome: how prolonged prospects would take to finish a single roundtrip to my server if it had been in each metropolis.