Search code examples
azure-cdn

how to make sure where the cdn edge server we're accessing is located?


After creating a CDN endpoint that the origin is the blob storage, the performance seems to be very bad when we access the CDN endpoint from China. Is there any way to see if i'm accessing a Asia edge CDN server or North America edge server?

Can I just use command dig to get the returned ip, and look up the IP's location? (In this way, the IP is from North America)


Solution

  • Yes, you could find the CDN edge server through IP Location since the client always receives the response from the endpoint instead of the origin server in a CDN environment. But you might do not see the IP city location due to these POP city locations of some third party providers are not disclosed.

    For a CDN basic architecture, when a user clicks the URL in the address tab, the local DNS server will deliver the DNS resolution to a CDN dedicated DNS server, the CDN DNS server will tell an IP address from CDN global LB device to the user. This user will send the request to the CDN global LB device, the global LB device will tell this user a proper zone DNS LB server according to the client IP, request content, and region. Then this user will request to the zone DNS LB server. The zone DNS server will select a proper POP server to the global LB server based on these conditions: which one is nearest to the client, which one is having the expecting contents and which one could serve the client request. Eventually, the global LB server will response the proper POP server IP address to the user.

    You can see the DNS resolution using Dig command. I test this on a Linux Azure VM. I am using an endpoint for CDN with Standard Microsoft.

    enter image description here

    The effective method is to directly capture the network packages using Wireshark or network monitor.

    If you are using a windows machine, from a chrome browser, you can get the Remote Address when you send the HTTP/HTTPS request to cdnedpoint via clicking F12 button, check Network-Headers-Remote Address, and you will see the server IP address.

    enter image description here

    Besides, if China is a significant market for your customers and they need fast performance, consider using Azure CDN China instead. Azure CDN China delivers content from POPs inside of China by partnering with a number of local providers. You could get more details about China content delivery with Azure CDN.