0
votes

I have my google bucket connect with a load balancer and CDN enabled in google cloud, but I really don't get how google CDN working for static file, checking in the log viewer i can see the "statusDetails: response_from_cache" and "cacheHit: true" so i can say that the CDN is working properly.

Trying to issue a request for the image in my google CDN bucket from a computer located in Europe, the file return from the frontend IP address of my load balancer. Also the same IP address served my image if i make the request from a computer located in Asia.

So the same IP address was used for serving my static image ignore the location where the request coming from, checking the log viewer again, i can see that both of the request has claimed to go through google CDN, again google log viewer tell me that CDN working properly.

i think that the CDN should serve the file from the nearest server to the end-users, what is the point for using google CDN if the file always served from only 1 single IP address for all user over the world?

I have a free account of cloudflare, once i configure my DNS, the image file go through cloudflare network and if i do the test as above, i will see my static image file returned from multiple IP address which is nearest to my end-users.

Could somebody help me to understand what is the purpose for using google CDN in this case ? did i miss something in the configuration process for google CDN?

Thanks a lot in advance.

1
A single IP address can represent multiple systems around the world. This is called ANYCAST. The routing technology is Border Gateway Protocol (BGP).John Hanley
Thanks for pointing me to the right path @JohnHanley, but how can I see the benefit of google CDN and without CDN, since requesting the file right from the bucket url and from the load balancer frontend URL seem to be the same. I did the test from Asia and also from Europe, from each location I made 2 requests to the bucket and to the frontend url, time to wait is the same for both.user1350494
Testing CDN behavior is complicated. Google search for a research paper. In your case, use a trace route tool at each location and verify the path to each CDN. I use this online tool occasionally: tools.keycdn.com/traceroute There are other online tools to help you.John Hanley
Thanks a lot for your help @JohnHanleyuser1350494

1 Answers

0
votes
  • Google Cloud CDN uses Google's global edge network to serve content closer to users and it leverages Google Cloud global external HTTP(S) load balancers to provide routing, health checking, and Anycast IP support. The HTTP(S) load balancing configuration specifies the frontend IP addresses and ports on which Cloud CDN receives requests and the backends that originate responses to those requests.
  • Google CDN has a special feature of ‘single anycast IP for the whole network’ letting all contents served through the load balancer frontend IP resulting in low latency. So rather than having one load balancer per region, you can simplify your architecture and have every instance behind a single global load balancer. Also it has a feature of HTTP/2 which supports the latest HTTP protocol for faster performance. For additional information, you can check here.
  • Cloud CDN reduces latency by serving assets directly at Google's network edge. To know more about the caching using Cloud CDN, refer to this caching-overview docs.