I recently moved some of my site’s static content to be served through Amazon CloudFront. Testing on webpagetest.org from a few locations around the world, I wanted to confirm that this content would be served from regional locations. Results showed that the CloudFront files were always coming from Seattle regardless of the test location.
Upon closer inspection, it looks like the content was being served regionally, but the IP geo lookup was inaccurate. (In this case for Amazon it seems all their addresses are reported as Seattle, WA.)
The CloudFront files are served from domain cdn.scooterlabs.com which resolved as 205.251.205.2. Doing a traceroute to 205.251.205.2 from my office in San Francisco ends on a level3 network in Paris, so it appears the CDN files are being served regionally in this case.
My conclusion is that the IP Geo reverse lookup isn’t always accurate and might provide misleading results. This isn’t an issue specific to webpagetest.org (testing this same IP on a bunch of other Geo IP tools gave the same results), but just a caution I guess not to rely on it too much.
bcantoni, I worried about the same thing when I first started to use CDN. The best is to look at ping times from various world locations and compare them to the ping times you would get without your CDN.
Yep. I’ve been considering removing the MaxMind GEO lookup because it doesn’t do very well with CDN’s. I might just disable the lookup for CDN hosts since I’m already identifying those.
I’d be very grateful for any advice. On Sunday night my (UK based ecommerce) site went down and my web hosts told me it was under a massive DDoS attack. We had to sign up with a CDN company and have gone with an Edgecast reseller. The site is finally back up (48 hours later!) but, like pmeenan, the maxmind geo-ip lookup thinks everyone is based in the US.
Edgecast CDN does route people to the nearest server, but these servers still look like they’re in the US. We use Maxmind geo-lookup to select the most appropriate default currency and delivery charge for customers so without it (especially when it appears in dollars to our UK customers), our site is a lot worse off.
So far, neither maxmind or edgecast have been able to provide any advice on how I can use both of these services together.
If anyone has any advice then I’d be very grateful.
Most proxies/CDN’s will add a X-Forwarded-For header that tells you the IP address of the actual user. You should use that instead of the connected IP address (which will be the edgecast server). If you want to make your code flexible then you should use X-Forwarded-For always and fallback to the peer address if the header isn’t present.
There was actually a related post on SlashDot fairly recently about accurately geolocating a user from businesses and schools with onsite servers located in the local area, actually worked wonders in the city they were testing it in -although obviously out in the countryside things begin to look a bit more bleak due to the distances between isolated houses and the closest town with multiple businesses…
If anyone else read the same post, I’d be really grateful if they could PM me with the link or post it here - it was a great bit of research!
They are often accurate, but can also be poor.
For example, most geo databases list me as being in Adelaide. I am connected to the Internode POP in Adelaide, but I live in Perth.
In my case, I have an IP address that belongs to a very large geographical area.
Another example: an ISP might have a range that is used for Queensland. A device will get an IP address whether they are in Tweed Heads or Cape York. In that case, they may all look like they are in the same location.